JWTRefresh
Last updated
Was this helpful?
Was this helpful?
// Standard refresh — token must still be valid
newToken = jwtRefresh( oldToken, secret, "HS256" );
// Refresh with a new 1-hour expiration
newToken = jwtRefresh( oldToken, secret, "HS256", { expireIn: 3600 } );
// Allow refreshing an expired token (grace period)
newToken = jwtRefresh( oldToken, secret, "HS256", {
allowExpired : true,
expireIn : 3600
} );