From 05e367a84be35270ddd760880e721fff96b28293 Mon Sep 17 00:00:00 2001
From: chme
Date: Sun, 26 Dec 2021 20:19:51 +0100
Subject: [PATCH] [web] Add option to remove spotify (logout) in settings
---
web-src/src/pages/SettingsPageOnlineServices.vue | 11 ++++++++++-
web-src/src/webapi/index.js | 4 ++++
2 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/web-src/src/pages/SettingsPageOnlineServices.vue b/web-src/src/pages/SettingsPageOnlineServices.vue
index 1658794d..e0acd981 100644
--- a/web-src/src/pages/SettingsPageOnlineServices.vue
+++ b/web-src/src/pages/SettingsPageOnlineServices.vue
@@ -67,6 +67,11 @@
Access to the Spotify Web API enables scanning of your Spotify library. Required scopes are
{{ spotify_required_scope | join }}
.
+
@@ -141,7 +146,7 @@ export default {
},
spotify_required_scope () {
- if (this.spotify.webapi_token_valid && this.spotify.webapi_granted_scope && this.spotify.webapi_required_scope) {
+ if (this.spotify.webapi_required_scope) {
return this.spotify.webapi_required_scope.split(' ')
}
return []
@@ -176,6 +181,10 @@ export default {
})
},
+ logout_spotify () {
+ webapi.spotify_logout()
+ },
+
login_lastfm () {
webapi.lastfm_login(this.lastfm_login).then(response => {
this.lastfm_login.user = ''
diff --git a/web-src/src/webapi/index.js b/web-src/src/webapi/index.js
index 3ee2a98d..bc14b78e 100644
--- a/web-src/src/webapi/index.js
+++ b/web-src/src/webapi/index.js
@@ -356,6 +356,10 @@ export default {
return axios.post('./api/spotify-login', credentials)
},
+ spotify_logout () {
+ return axios.get('./api/spotify-logout')
+ },
+
lastfm () {
return axios.get('./api/lastfm')
},