Commit 7d94be09 authored by Jérémie Passerat's avatar Jérémie Passerat

Essai de captage d'une erreur liée au token

parent 1857ed08
......@@ -22,9 +22,16 @@ export default {
let decoded = jwt.verify(token, 'l\'ordinateur-c\'est-magique')
let tempsRestant = new Date(1000 * decoded.exp - Date.now())
if (tempsRestant.getHours() === 1 && tempsRestant.getMinutes() < 15){
alert("Alert, je le suis ici")
this.refreshToken().then(function (response) {
localStorage.token = response.data.access_token
})
}) .catch(function (error) {
if (error.response) {
console.log(error.response.data)
console.log(error.response.status)
console.log(error.response.headers)
}
});
}
}
catch (JsonWebTokenError) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment