diff --git a/ui/src/store/modules/user.js b/ui/src/store/modules/user.js index 21cd603e378c..0cb4cf97c81c 100644 --- a/ui/src/store/modules/user.js +++ b/ui/src/store/modules/user.js @@ -219,7 +219,7 @@ const user = { commit('SET_PROJECT', {}) commit('SET_HEADER_NOTICES', []) commit('SET_FEATURES', {}) - commit('SET_LDAP', {}) + commit('SET_LDAP', false) commit('SET_CLOUDIAN', {}) commit('SET_DOMAIN_STORE', {}) commit('SET_LOGOUT_FLAG', false) @@ -268,7 +268,7 @@ const user = { commit('SET_PROJECT', {}) commit('SET_HEADER_NOTICES', []) commit('SET_FEATURES', {}) - commit('SET_LDAP', {}) + commit('SET_LDAP', false) commit('SET_CLOUDIAN', {}) commit('SET_DOMAIN_STORE', {}) commit('SET_LOGOUT_FLAG', false) @@ -420,10 +420,10 @@ const user = { }) api('listLdapConfigurations').then(response => { - const ldapEnable = (response.ldapconfigurationresponse.count > 0) + const ldapEnable = (response && response.ldapconfigurationresponse && response.ldapconfigurationresponse.count > 0) commit('SET_LDAP', ldapEnable) - }).catch(error => { - reject(error) + }).catch(ignored => { + commit('SET_LDAP', false) }) api('cloudianIsEnabled').then(response => { @@ -448,7 +448,7 @@ const user = { commit('SET_PROJECT', {}) commit('SET_HEADER_NOTICES', []) commit('SET_FEATURES', {}) - commit('SET_LDAP', {}) + commit('SET_LDAP', false) commit('SET_CLOUDIAN', {}) commit('RESET_THEME') commit('SET_DOMAIN_STORE', {}) @@ -551,11 +551,12 @@ const user = { } }) }, - UpdateConfiguration ({ commit }) { + UpdateLdapConfigurationFlag ({ commit }) { return new Promise((resolve, reject) => { api('listLdapConfigurations').then(response => { - const ldapEnable = (response.ldapconfigurationresponse.count > 0) + const ldapEnable = (response && response.ldapconfigurationresponse && response.ldapconfigurationresponse.count > 0) commit('SET_LDAP', ldapEnable) + resolve(ldapEnable) }).catch(error => { reject(error) }) diff --git a/ui/src/utils/request.js b/ui/src/utils/request.js index 7c757691f2b3..30d81af753e1 100644 --- a/ui/src/utils/request.js +++ b/ui/src/utils/request.js @@ -51,7 +51,7 @@ const err = (error) => { }) } if (response.status === 401) { - if (response.config && response.config.params && ['forgotPassword', 'listIdps', 'cloudianIsEnabled'].includes(response.config.params.command)) { + if (response.config && response.config.params && ['forgotPassword', 'listIdps', 'cloudianIsEnabled', 'listLdapConfigurations'].includes(response.config.params.command)) { return } const originalPath = router.currentRoute.value.fullPath diff --git a/ui/src/views/AutogenView.vue b/ui/src/views/AutogenView.vue index 325df769deef..d2d388897397 100644 --- a/ui/src/views/AutogenView.vue +++ b/ui/src/views/AutogenView.vue @@ -1600,7 +1600,7 @@ export default { } } if (['addLdapConfiguration', 'deleteLdapConfiguration'].includes(action.api)) { - this.$store.dispatch('UpdateConfiguration') + this.$store.dispatch('UpdateLdapConfigurationFlag') } if (jobId) { eventBus.emit('update-resource-state', { selectedItems: this.selectedItems, resource, state: 'InProgress', jobid: jobId })