diff --git a/htdocs/admin.html b/htdocs/admin.html index 0198ba78..3e5bdaf2 100644 --- a/htdocs/admin.html +++ b/htdocs/admin.html @@ -213,6 +213,7 @@

Spotify Web API: access authorized for {{ spotify.webapi_user }}

+

Please reauthorize Web API access to grant forked-daapd the following additional access rights: {{ spotify_missing_scope | join }}

Reauthorize Web API access
diff --git a/htdocs/admin/js/forked-daapd.js b/htdocs/admin/js/forked-daapd.js index 0404f75f..de51bb76 100644 --- a/htdocs/admin/js/forked-daapd.js +++ b/htdocs/admin/js/forked-daapd.js @@ -24,6 +24,15 @@ var app = new Vue({ this.loadLastfm(); }, + computed: { + spotify_missing_scope () { + if (this.spotify.webapi_token_valid && this.spotify.webapi_granted_scope && this.spotify.webapi_required_scope) { + return this.spotify.webapi_required_scope.split(' ').filter(scope => this.spotify.webapi_granted_scope.indexOf(scope) < 0) + } + return [] + } + }, + methods: { loadConfig: function() { axios.get('/api/config').then(response => {