improvements
This commit is contained in:
parent
8c1bff3a20
commit
30954310e1
@ -235,7 +235,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.evalAuthentication();
|
//this.evalAuthentication();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
//openURL
|
//openURL
|
||||||
|
|||||||
@ -82,7 +82,6 @@ export default function ({store}/* { store, ssrContext } */) {
|
|||||||
return next();
|
return next();
|
||||||
}
|
}
|
||||||
}).finally(() => {
|
}).finally(() => {
|
||||||
console.log("finally...");
|
|
||||||
store.commit('auth/SET_AUTHENTICATED');
|
store.commit('auth/SET_AUTHENTICATED');
|
||||||
store.commit('auth/SET_USER');
|
store.commit('auth/SET_USER');
|
||||||
});
|
});
|
||||||
|
|||||||
@ -14,7 +14,6 @@ export const SET_LOGOUT = (state) => {
|
|||||||
localStorage.removeItem('userToken');
|
localStorage.removeItem('userToken');
|
||||||
state.userAuthenticated = null;
|
state.userAuthenticated = null;
|
||||||
state.isAuthenticated = false;
|
state.isAuthenticated = false;
|
||||||
console.log(localStorage.getItem('userToken'));
|
|
||||||
};
|
};
|
||||||
export const SET_USER = (state) => {
|
export const SET_USER = (state) => {
|
||||||
console.log("SET_USER()");
|
console.log("SET_USER()");
|
||||||
@ -26,16 +25,13 @@ export const SET_USER = (state) => {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
.then((response) => {
|
.then((response) => {
|
||||||
console.log("GET/POST /api/getUser - response: ");
|
console.log("GET /api/getUser");
|
||||||
console.log(response.data);
|
|
||||||
state.userAuthenticated = response.data;
|
state.userAuthenticated = response.data;
|
||||||
state.isAuthenticated = true;
|
state.isAuthenticated = true;
|
||||||
if (state.userAuthenticated.hasOwnProperty('password')) delete state.userAuthenticated.password;
|
if (state.userAuthenticated.hasOwnProperty('password')) delete state.userAuthenticated.password;
|
||||||
console.log(state.userAuthenticated);
|
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
console.log("Catch Block: ")
|
console.log("error")
|
||||||
console.log(error)
|
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
state.isAuthenticated = false;
|
state.isAuthenticated = false;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user