瀏覽代碼

logout if session is not valid

pull/1/head
Jonathan Cobb 4 年之前
父節點
當前提交
58dc73fc57
共有 1 個檔案被更改,包括 9 行新增1 行删除
  1. +9
    -1
      src/_store/account.module.js

+ 9
- 1
src/_store/account.module.js 查看文件

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


Loading…
取消
儲存