mirror of
https://github.com/Bubka/2FAuth.git
synced 2025-06-24 14:02:09 +02:00
Route to error page on bad logout to prevent unrevoked token
This commit is contained in:
parent
35a6b0d87c
commit
84a9ba4297
@ -183,15 +183,13 @@
|
|||||||
axios.post('api/logout').then(response => {
|
axios.post('api/logout').then(response => {
|
||||||
|
|
||||||
localStorage.removeItem('jwt');
|
localStorage.removeItem('jwt');
|
||||||
|
localStorage.removeItem('user');
|
||||||
delete axios.defaults.headers.common['Authorization'];
|
delete axios.defaults.headers.common['Authorization'];
|
||||||
|
|
||||||
this.$router.go('/login');
|
this.$router.go('/login');
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
localStorage.removeItem('jwt');
|
this.$router.push({ name: 'error' });
|
||||||
delete axios.defaults.headers.common['Authorization'];
|
|
||||||
|
|
||||||
this.$router.go('/login');
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user