I am trying to use the latest version of the module only I keep getting issues when trying to sign a token with the expiresIn and jwtid-ptions. Only keep getting the same error (see below) keeps complaining about number payload but why? The documents seem to suggest it can be a string. What am I doing wrong?
Error: invalid expiresIn,jwtid option for number payload
at Object.module.exports [as sign] (/Users/Development/Projects/xyz/backend/node_modules/jsonwebtoken/sign.js:81:22)
I am using the following code:
return jwt.sign(
payload, // This is the payload we want to put inside the token
process.env.TOKEN_SECRET || "oursecret", // Secret string which will be used to sign the token,
{
expiresIn: '2h', // let the token expire after 2 hours of creation
jwtid: identifier, // unique identifier (uuid.v4())
}
);
I am trying to use the latest version of the module only I keep getting issues when trying to sign a token with the
expiresInandjwtid-ptions. Only keep getting the same error (see below) keeps complaining about number payload but why? The documents seem to suggest it can be a string. What am I doing wrong?I am using the following code: