Cara menandatangani token JWT di JS yang tidak kedaluwarsa
var token = jwt.sign({email:'[email protected]',role:'User'}, "Secret", {});
Emmanuel Mahuni
var token = jwt.sign({email:'[email protected]',role:'User'}, "Secret", {});
var token = jwt.sign({email_id:'[email protected]'}, "Stack", {
expiresIn: '24h' // expires in 24 hours
});
$ npm install jwt-simple
jwt.sign({ exp: Math.floor(Date.now() / 1000) + (60 * 60), data: 'foobar'}, 'secret');