Check whether a decoded JWT is expired.
The decoded JWT payload.
Current time in seconds since epoch. Defaults to Math.floor(Date.now() / 1000).
Math.floor(Date.now() / 1000)
Grace period in seconds. Defaults to 0.
0
true if the token has an exp claim and it is in the past.
true
exp
if (isExpired(jwt.payload)) { // refresh or redirect to login} Copy
if (isExpired(jwt.payload)) { // refresh or redirect to login}
Check whether a decoded JWT is expired.