diff options
Diffstat (limited to 'src/store/modules/Authentication')
-rw-r--r-- | src/store/modules/Authentication/AuthenticanStore.js | 6 |
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'); |