diff options
Diffstat (limited to 'src/router')
-rw-r--r-- | src/router/index.js | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/router/index.js b/src/router/index.js index c3d44390..33743fe0 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -98,6 +98,9 @@ const router = new VueRouter({ }); router.beforeEach((to, from, next) => { + // Commit logout to remove XSRF-TOKEN cookie when + // redirected to login page (eg 401 response) + if (to.name === 'login') store.commit('authentication/logout'); if (to.matched.some(record => record.meta.requiresAuth)) { if (store.getters['authentication/isLoggedIn']) { next(); |