summaryrefslogtreecommitdiff
path: root/src/store/modules/Authentication/AuthenticanStore.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/store/modules/Authentication/AuthenticanStore.js')
-rw-r--r--src/store/modules/Authentication/AuthenticanStore.js12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/store/modules/Authentication/AuthenticanStore.js b/src/store/modules/Authentication/AuthenticanStore.js
index 57270159..2006661b 100644
--- a/src/store/modules/Authentication/AuthenticanStore.js
+++ b/src/store/modules/Authentication/AuthenticanStore.js
@@ -1,6 +1,7 @@
import api from '@/store/api';
import Cookies from 'js-cookie';
import router from '@/router';
+import { roles } from '@/router/routes';
const AuthenticationStore = {
namespaced: true,
@@ -68,7 +69,16 @@ const AuthenticationStore = {
commit('global/setPrivilege', data.RoleId, { root: true });
return data;
})
- .catch((error) => console.log(error));
+ .catch((error) => {
+ if (error.response?.status === 404) {
+ // We have valid credentials but user isn't known, assume remote
+ // authentication (e.g. LDAP) and do not restrict the routing
+ commit('global/setPrivilege', roles.administrator, { root: true });
+ return {};
+ } else {
+ console.log(error);
+ }
+ });
},
resetStoreState({ state }) {
state.authError = false;