Skip to content

Commit

Permalink
fix spelling error in error message
Browse files Browse the repository at this point in the history
  • Loading branch information
junosuarez committed Jul 16, 2015
1 parent f13b3fb commit 8078b11
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ JWT.verify = function(jwtString, secretOrPublicKey, options, callback) {
return done(new JsonWebTokenError('iat required when maxAge is specified'));
}
if (Date.now() - (payload.iat * 1000) > maxAge) {
return done(new TokenExpiredError('maxAge exceded', new Date(payload.iat * 1000 + maxAge)));
return done(new TokenExpiredError('maxAge exceeded', new Date(payload.iat * 1000 + maxAge)));
}
}

Expand Down
4 changes: 2 additions & 2 deletions test/verify.tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ describe('verify', function() {

jwt.verify(token, key, options, function (err, p) {
assert.equal(err.name, 'TokenExpiredError');
assert.equal(err.message, 'maxAge exceded');
assert.equal(err.message, 'maxAge exceeded');
assert.equal(err.expiredAt.constructor.name, 'Date');
assert.equal(Number(err.expiredAt), 1437018582321);
assert.isUndefined(p);
Expand All @@ -93,7 +93,7 @@ describe('verify', function() {

jwt.verify(token, key, options, function (err, p) {
assert.equal(err.name, 'TokenExpiredError');
assert.equal(err.message, 'maxAge exceded');
assert.equal(err.message, 'maxAge exceeded');
assert.equal(err.expiredAt.constructor.name, 'Date');
assert.equal(Number(err.expiredAt), 1437018582800);
assert.isUndefined(p);
Expand Down

0 comments on commit 8078b11

Please sign in to comment.