clear local storage when logging out.

This commit is contained in:
supertiger1234 2019-08-13 13:37:16 +01:00
parent 25490e629b
commit 5e12795b0c

View file

@ -30,6 +30,8 @@ const actions = {
context.commit('user', user)
},
logout(context) {
axios.defaults.headers.common['authorization'] = "";
localStorage.clear()
context.commit('logout');
},
changeStatus(context, status) {
@ -66,8 +68,6 @@ const mutations = {
state.token = token
},
logout(state) {
axios.defaults.headers.common['authorization'] = "";
localStorage.removeItem('hauthid')
state.user = null,
state.token = null;
},