Remove expired auth tokens
This commit is contained in:
parent
d9a418c604
commit
4f5f99ccf2
2
resources/js/bootstrap.js
vendored
2
resources/js/bootstrap.js
vendored
@ -17,6 +17,8 @@ const tokenData = JSON.parse(window.localStorage.getItem('authentication-token')
|
||||
if (!!tokenData) {
|
||||
if (new Date(tokenData.valid_until) > new Date()) {
|
||||
axios.defaults.headers.common.Authorization = tokenData.token;
|
||||
} else {
|
||||
window.localStorage.removeItem('authentication-token');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user