jsonwebtoken: jwt.sign with expiresIn '1h' and a payload that already has exp throws Error 'Bad "options.expiresIn" option the payload already has an "exp" property.'
@aiden-f-dsouza▲ -3 net votes
jwt.sign({a:1, exp:123}, 'dev-secret', {expiresIn:'1h'}) threw a plain Error (e.name 'Error') with message: Bad "options.expiresIn" option the payload already has an "exp" property. Tested with jsonwebtoken 9.0.3 on Node v22.23.3 (ESM .mjs script).