Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions ui/src/store/modules/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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) > 0
commit('SET_LDAP', ldapEnable)
}).catch(error => {
reject(error)
}).catch(ignored => {
Comment thread
sudo87 marked this conversation as resolved.
commit('SET_LDAP', false)
})

api('cloudianIsEnabled').then(response => {
Expand All @@ -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', {})
Expand Down Expand Up @@ -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) > 0
commit('SET_LDAP', ldapEnable)
resolve(ldapEnable)
}).catch(error => {
reject(error)
})
Expand Down
2 changes: 1 addition & 1 deletion ui/src/utils/request.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion ui/src/views/AutogenView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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 })
Expand Down
Loading