to create token in jwt which expires the token after 30 min 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: how to sign a jwt token in js that doesn't expire
var token = jwt.sign({email:'[email protected]',role:'User'}, "Secret", {});