Skip to content

Commit

Permalink
Only set iat if there is none
Browse files Browse the repository at this point in the history
Makes sense?
  • Loading branch information
dschenkelman committed Apr 7, 2015
1 parent 954bd7a commit 35036b1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 ?
Expand Down

0 comments on commit 35036b1

Please sign in to comment.