nodejs jwt expiresIn code example
Example 1: json web token npm global
$ npm install jsonwebtoken
Example 2: how to set expire time of jwt token in node js
var token = jwt.sign({email_id:'[email protected]'}, "Stack", {
expiresIn: '24h' // expires in 24 hours
});
Example 3: jsonwebtoken
var jwt = require('jsonwebtoken');var token = jwt.sign({ foo: 'bar' }, 'shhhhh');