make sure to clear old token when logout
This commit is contained in:
parent
03a27c6d48
commit
268e9ce504
3 changed files with 7 additions and 2 deletions
|
@ -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')
|
||||
|
|
Loading…
Reference in a new issue