mirror of
https://github.com/hanzoai/node-jsonwebtoken.git
synced 2026-09-24 17:00:48 +00:00
Merge pull request #75 from auth0/dschenkelman-patch-1
Only set iat if there is none
This commit is contained in:
@@ -39,7 +39,7 @@ module.exports.sign = function(payload, secretOrPrivateKey, options) {
|
||||
|
||||
var timestamp = Math.floor(Date.now() / 1000);
|
||||
if (!options.noTimestamp) {
|
||||
payload.iat = timestamp;
|
||||
payload.iat = payload.iat || timestamp;
|
||||
}
|
||||
|
||||
var expiresInSeconds = options.expiresInMinutes ?
|
||||
|
||||
Reference in New Issue
Block a user