JWT EXPIRATION code example
Example 1: extract payload of expired jwt token in js
if(err.name === 'TokenExpiredError') {
const payload = jwt.verify(token, SECRET, {ignoreExpiration: true} );
// your code
}
Example 2: jwt expiresin
var token = jwt.sign({email_id:'[email protected]'}, "Stack", {
expiresIn: '24h' // expires in 24 hours
});