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