diff options
author | Derick Montague <derick.montague@ibm.com> | 2020-02-13 00:55:42 +0300 |
---|---|---|
committer | Derick Montague <derick.montague@ibm.com> | 2020-02-14 17:55:23 +0300 |
commit | c031b6988d6381ae1d2ecefd04e8c2af47f0ff4a (patch) | |
tree | 6baf3d27353766f9c5bc5fc3ec943c6a199864de /src/store/modules | |
parent | 537c6cb6b293665826efc5b1ef9f9c9c2e6a0d39 (diff) | |
download | webui-vue-c031b6988d6381ae1d2ecefd04e8c2af47f0ff4a.tar.xz |
Clear application state on logout
Remove the authError state property from the logout mutation
since the the authError would not be in the true state after
a successful login.
Signed-off-by: Derick Montague <derick.montague@ibm.com>
Change-Id: Ibfe8b07c4e9e37dfab4435596c12e9a36556a714
Diffstat (limited to 'src/store/modules')
-rw-r--r-- | src/store/modules/Authentication/AuthenticanStore.js | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/store/modules/Authentication/AuthenticanStore.js b/src/store/modules/Authentication/AuthenticanStore.js index 8d8898ef..975f258b 100644 --- a/src/store/modules/Authentication/AuthenticanStore.js +++ b/src/store/modules/Authentication/AuthenticanStore.js @@ -1,5 +1,6 @@ import api from '../../api'; import Cookies from 'js-cookie'; +import router from '../../../router'; const AuthenticationStore = { namespaced: true, @@ -19,8 +20,7 @@ const AuthenticationStore = { authError(state) { state.authError = true; }, - logout(state) { - state.authError = false; + logout() { Cookies.remove('XSRF-TOKEN'); } }, @@ -38,6 +38,7 @@ const AuthenticationStore = { api .post('/logout', { data: [] }) .then(() => commit('logout')) + .then(() => router.go('/login')) .catch(error => console.log(error)); } } |