Selaa lähdekoodia

logout if session is not valid

pull/1/head
Jonathan Cobb 4 vuotta sitten
vanhempi
commit
58dc73fc57
1 muutettua tiedostoa jossa 9 lisäystä ja 1 poistoa
  1. +9
    -1
      src/_store/account.module.js

+ 9
- 1
src/_store/account.module.js Näytä tiedosto

@@ -34,7 +34,15 @@ const actions = {
userService.getMe(messages, errors)
.then(
user => commit('checkSessionSuccess', user),
error => commit('checkSessionFailure', error)
error => {
commit('checkSessionFailure', error);
if (error === 'Not Found' || error === 'Forbidden') {
userService.logout(messages, errors).then(
ok => router.replace('/login'),
error => router.replace('/login')
);
}
}
);
},
login({ dispatch, commit }, { user, messages, errors }) {


Ladataan…
Peruuta
Tallenna