diff --git a/openid-connect-server-webapp/src/main/webapp/resources/js/admin.js b/openid-connect-server-webapp/src/main/webapp/resources/js/admin.js index 2e83f1622..cf710eead 100644 --- a/openid-connect-server-webapp/src/main/webapp/resources/js/admin.js +++ b/openid-connect-server-webapp/src/main/webapp/resources/js/admin.js @@ -738,9 +738,7 @@ var AppRouter = Backbone.Router.extend({ this.updateSidebar('admin/whitelists'); - //// - var whiteList = this.whiteListList.get(id); - whiteList = new WhiteListModel({id: id}); + var whiteList = new WhiteListModel(); var client = this.clientList.get(cid); if (!client) { @@ -751,6 +749,10 @@ var AppRouter = Backbone.Router.extend({ view.load( function() { + + // set the scopes on the model now that everything's loaded + whiteList.set({allowedScopes: client.get('scope')}, {silent: true}); + $('#content').html(view.render().el); view.delegateEvents(); setPageTitle($.t('whitelist.manage')); diff --git a/openid-connect-server-webapp/src/main/webapp/resources/js/whitelist.js b/openid-connect-server-webapp/src/main/webapp/resources/js/whitelist.js index a39a72eda..524e64ebb 100644 --- a/openid-connect-server-webapp/src/main/webapp/resources/js/whitelist.js +++ b/openid-connect-server-webapp/src/main/webapp/resources/js/whitelist.js @@ -341,7 +341,7 @@ var WhiteListFormView = Backbone.View.extend({ // process allowed scopes var allowedScopes = this.scopeCollection.pluck("item"); - this.model.set(this.options.client.get('clientId')); + this.model.set({clientId: this.options.client.get('clientId')}, {silent: true}); var valid = this.model.set({ allowedScopes: allowedScopes