improvements

This commit is contained in:
Timo Volkmann 2019-05-10 19:00:51 +02:00
parent 8c1bff3a20
commit 30954310e1
3 changed files with 3 additions and 8 deletions

View File

@ -235,7 +235,7 @@
}
},
created() {
this.evalAuthentication();
//this.evalAuthentication();
},
methods: {
//openURL

View File

@ -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');
});

View File

@ -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;