From 84a9ba42973fe23d0b4bdad8ea21023f22087574 Mon Sep 17 00:00:00 2001 From: Bubka <858858+Bubka@users.noreply.github.com> Date: Fri, 10 Jan 2020 13:54:58 +0100 Subject: [PATCH] Route to error page on bad logout to prevent unrevoked token --- resources/js/views/Accounts.vue | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/resources/js/views/Accounts.vue b/resources/js/views/Accounts.vue index 71f22114..0a9de1ca 100644 --- a/resources/js/views/Accounts.vue +++ b/resources/js/views/Accounts.vue @@ -183,15 +183,13 @@ axios.post('api/logout').then(response => { localStorage.removeItem('jwt'); + localStorage.removeItem('user'); delete axios.defaults.headers.common['Authorization']; this.$router.go('/login'); }) .catch(error => { - localStorage.removeItem('jwt'); - delete axios.defaults.headers.common['Authorization']; - - this.$router.go('/login'); + this.$router.push({ name: 'error' }); }); } }