Sfoglia il codice sorgente

logout if session is not valid

pull/1/head
Jonathan Cobb 4 anni fa
parent
commit
58dc73fc57
1 ha cambiato i file con 9 aggiunte e 1 eliminazioni
  1. +9
    -1
      src/_store/account.module.js

+ 9
- 1
src/_store/account.module.js Vedi File

@@ -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 }) {


Caricamento…
Annulla
Salva