Closed josuemma closed 7 years ago
Hello @josuemma It is not wrong.
It is actually token.exp
. Try to log the value of token in your console to see all its properties. exp
is the property that denotes the token expiration date.
Date in UTC is the is when the token.exp
value has been converted to UTC.
Great Tutorial, Just a quick note:
I think in the function getTokenExpirationDate the property used to get the expiration date should be token.token_expiration_date
function getTokenExpirationDate (encodedToken) { const token = decode(encodedToken) if (!token.token_expiration_date) { return null }
const date = new Date(0) date.setUTCSeconds(token.token_expiration_date)
return date }
Cheers