summaryrefslogtreecommitdiff
path: root/src/store/modules/Authentication
diff options
context:
space:
mode:
authorVitalii Lysak <v.lysak@dunice.net>2022-08-31 16:17:26 +0300
committerVitalii Lysak <v.lysak@dunice.net>2022-08-31 16:21:29 +0300
commit5cb3ede0b4f441c2ca6e3647bb08dee3d4286603 (patch)
tree048a1558019e202b66d4937e2999d712dcc86e0a /src/store/modules/Authentication
parent9123716b55d809bf8d1cc4727b3b10c127b405a0 (diff)
downloadwebui-vue-5cb3ede0b4f441c2ca6e3647bb08dee3d4286603.tar.xz
SILABMC-282|283: upd rights for Operator and NoAccess rolse
Diffstat (limited to 'src/store/modules/Authentication')
-rw-r--r--src/store/modules/Authentication/AuthenticanStore.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/store/modules/Authentication/AuthenticanStore.js b/src/store/modules/Authentication/AuthenticanStore.js
index a574331b..45aec3ee 100644
--- a/src/store/modules/Authentication/AuthenticanStore.js
+++ b/src/store/modules/Authentication/AuthenticanStore.js
@@ -49,18 +49,18 @@ const AuthenticationStore = {
return api
.post('/login', { data: [username, password] })
.then(() => {
- dispatch('getUser', username)
+ return dispatch('getUser', username)
.then((response) => {
if (response.data?.RoleId) {
commit('setRole', response.data.RoleId);
+ commit('authSuccess');
}
})
.catch((error) => {
+ dispatch('logout');
commit('authError');
throw new Error(error);
});
-
- commit('authSuccess');
})
.catch((error) => {
commit('authError');