Skip to content

Commit

Permalink
Modify jwt iat from valueOf to unix
Browse files Browse the repository at this point in the history
iat expressed as seconds from epoch instead of milliseconds from epoch
  • Loading branch information
AndreiEnache authored Dec 4, 2019
1 parent ed5da26 commit c4e1a84
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/services/token.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const AppError = require('../utils/AppError');
const generateToken = (userId, expires, secret = config.jwt.secret) => {
const payload = {
sub: userId,
iat: moment().valueOf(),
iat: moment().unix(),
exp: expires.unix(),
};
return jwt.sign(payload, secret);
Expand Down

0 comments on commit c4e1a84

Please sign in to comment.