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.js8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/store/modules/Authentication/AuthenticanStore.js b/src/store/modules/Authentication/AuthenticanStore.js
index 07d5ee8b..88fb54b8 100644
--- a/src/store/modules/Authentication/AuthenticanStore.js
+++ b/src/store/modules/Authentication/AuthenticanStore.js
@@ -5,11 +5,13 @@ import router from '@/router';
const AuthenticationStore = {
namespaced: true,
state: {
+ consoleWindow: null,
authError: false,
xsrfCookie: Cookies.get('XSRF-TOKEN'),
isAuthenticatedCookie: Cookies.get('IsAuthenticated'),
},
getters: {
+ consoleWindow: (state) => state.consoleWindow,
authError: (state) => state.authError,
isLoggedIn: (state) => {
return (
@@ -33,6 +35,7 @@ const AuthenticationStore = {
state.xsrfCookie = undefined;
state.isAuthenticatedCookie = undefined;
},
+ setConsoleWindow: (state, window) => (state.consoleWindow = window),
},
actions: {
login({ commit }, { username, password }) {
@@ -48,7 +51,10 @@ const AuthenticationStore = {
logout({ commit }) {
api
.post('/logout', { data: [] })
- .then(() => commit('logout'))
+ .then(() => {
+ commit('setConsoleWindow', false);
+ commit('logout');
+ })
.then(() => router.go('/login'))
.catch((error) => console.log(error));
},