Fix: for LDAP auth when user credentials are invalid (#407)

* Fix: for LDAP auth when user credentials are invalid

* Fix: for LDAP auth when user credentials are invalid
This commit is contained in:
Gopalakrishna Palem 2023-11-30 19:33:37 +05:30 committed by GitHub
parent 7f33cc8805
commit 7e0f460d9e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -92,7 +92,7 @@ const funcs = {
})
},
is(role) {
return this.$store.state.user.role == role
return this.$store.state?.user?.role == role
},
can(permissions) {
return this.$store.getters.hasPermissions(permissions)

View File

@ -24,9 +24,9 @@ export default new Vuex.Store({
getters: {
hasPermissions: (state) => (permissions) => {
if (_.isArray(permissions)) {
return _.intersection(state.user.permissions, permissions).length == permissions.length
return _.intersection(state.user?.permissions, permissions).length == permissions.length
}
return _.find(state.user.permissions, p => p == permissions) ? true : false
return _.find(state.user?.permissions, p => p == permissions) ? true : false
}
},
mutations: {