create jwt token

 

var jwt = require(‘jsonwebtoken’);
let user = {
email: ‘userDetails.email’,
firstName: ‘userDetails.firstName’,
lastName: ‘userDetails.lastName’,
userType: ‘userDetails.userType’,
id: ‘userDetails.id’,
}

const expiresInSecs = 120;
const token = jwt.sign({
data: user
}, ‘secret_key’, { expiresIn: 60 * 60 });

console.log(‘ttttttttt’, token)

Leave a Comment

Your email address will not be published. Required fields are marked *