I need to get a token by signing a user ID with JWT:
var token = jwt.sign(accounts[request.headers.login].id, privateKey, {expiresIn: 60});
Where id
and privateKey
are strings.
The error is Error: Uncaught error: "expiresIn" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60
.
If I remove options object at all, it works, but without options I need to set.
The issue seems to be simple but I don't know how to fix it, what am I doing wrong?