Added logout
This commit is contained in:
@@ -12,7 +12,7 @@ export default new Vuex.Store({
|
||||
storeUser(state, payload) {
|
||||
state.user = payload;
|
||||
},
|
||||
cleanUserData(state) {
|
||||
clearUserData(state) {
|
||||
state.user = undefined;
|
||||
},
|
||||
},
|
||||
@@ -32,6 +32,9 @@ export default new Vuex.Store({
|
||||
console.error(e);
|
||||
})
|
||||
},
|
||||
logout({ commit }) {
|
||||
commit('clearUserData');
|
||||
}
|
||||
},
|
||||
getters: {
|
||||
auth: (state) => state.user !== undefined,
|
||||
|
||||
Reference in New Issue
Block a user