I am using NodeJs with JsonWebtoken Module.
I am facing this error when calling sign method of json web token
ValidationError: "expiresInMinutes" is not allowed
var jwt = require('jsonwebtoken');
exports.authenticate = function(req, res, next) {
var user = {"Name":"Abdul"} //static data for test purpose.
var token = jwt.sign(user, req.app.get('jwtTokenSecret'), {
expiresInMinutes: 1440 // expires in 24 hours
});
// return the information including token as JSON
res.json({
success: true,
message: 'Enjoy your token!',
token: token
});
}