Add logout button.
This commit is contained in:
parent
b284689313
commit
7d59051fc5
15 changed files with 45 additions and 19 deletions
|
@ -26,6 +26,9 @@ export const mutations = {
|
|||
setCurrentUser (state, user) {
|
||||
state.currentUser = merge(state.currentUser || {}, user)
|
||||
},
|
||||
clearCurrentUser (state) {
|
||||
state.currentUser = false
|
||||
},
|
||||
beginLogin (state) {
|
||||
state.loggingIn = true
|
||||
},
|
||||
|
@ -66,6 +69,11 @@ const users = {
|
|||
store.commit('setUserForStatus', status)
|
||||
})
|
||||
},
|
||||
logout (store) {
|
||||
store.commit('clearCurrentUser')
|
||||
store.dispatch('stopFetching', 'friends')
|
||||
store.commit('setBackendInteractor', backendInteractorService())
|
||||
},
|
||||
loginUser (store, userCredentials) {
|
||||
return new Promise((resolve, reject) => {
|
||||
const commit = store.commit
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue