Commit 268e9ce5 authored by Tae Hoon's avatar Tae Hoon

make sure to clear old token when logout

parent 03a27c6d
......@@ -19,7 +19,8 @@ const saveImmedeatelyActions = [
'setHighlight',
'setOption',
'setClientData',
'setToken'
'setToken',
'clearToken'
]
const defaultStorage = (() => {
......
......@@ -22,6 +22,10 @@ const oauth = {
},
setToken (state, token) {
state.userToken = token
},
clearToken (state) {
state.userToken = false
state.token = false
}
},
getters: {
......
......@@ -399,7 +399,7 @@ const users = {
logout (store) {
store.commit('clearCurrentUser')
store.dispatch('disconnectFromChat')
store.commit('setToken', false)
store.commit('clearToken')
store.dispatch('stopFetching', 'friends')
store.commit('setBackendInteractor', backendInteractorService(store.getters.getToken()))
store.dispatch('stopFetching', 'notifications')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment