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