Route to error page on bad logout to prevent unrevoked token

This commit is contained in:
Bubka 2020-01-10 13:54:58 +01:00
parent 35a6b0d87c
commit 84a9ba4297

View File

@ -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' });
});
}
}