jwt expiresIn code example
Example 1: how to sign a jwt token in js that doesn't expire
var token = jwt.sign({email:'[email protected]',role:'User'}, "Secret", {});
Example 2: json web token npm global
$ npm install jsonwebtoken
Example 3: jwt expiresin
var token = jwt.sign({email_id:'[email protected]'}, "Stack", {
expiresIn: '24h' // expires in 24 hours
});
Example 4: npm package for jwt
$ npm install jwt-simple
Example 5: jsonwebtoken
jwt.sign({ exp: Math.floor(Date.now() / 1000) + (60 * 60), data: 'foobar'}, 'secret');