How to set jwt token expiry time to maximum in nodejs?

The exp claim of a JWT is optional. If a token does not have it, it is considered that it does not expire

According to the documentation of https://www.npmjs.com/package/jsonwebtoken the expiresIn field does not have a default value either, so just omit it.

There are no default values for expiresIn, notBefore, audience, subject, issuer. These claims can also be provided in the payload directly with exp, nbf, aud, sub and iss respectively, but you can’t include them in both places.

var token = jwt.sign({email_id:'123@gmail.com'}, "Stack", {});

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)