Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Respect exp claim when provided in create() #30

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

typerandom
Copy link
Contributor

@typerandom typerandom commented Oct 1, 2016

Fix so that the exp claim is used if provided when calling create().

How to verify

Test it with the following code:

var nJwt = require('njwt');

var fakeSecret = 'd8b148ae-917e-4ec3-bb46-f36718ac5cde';
var currentEpochTime = Math.floor(new Date().getTime() / 1000);
var twoHoursFromNowInSeconds = currentEpochTime + (2 * 60 * 60);

var testOptions = {
  exp: twoHoursFromNowInSeconds * 1000 // As milliseconds.
};

var jwt = nJwt.create(testOptions, fakeSecret);

console.log('%s should be the same as %s', jwt.body.exp, twoHoursFromNowInSeconds);

Fixes #23

@coveralls
Copy link

coveralls commented Oct 1, 2016

Coverage Status

Coverage remained the same at 100.0% when pulling c63440e on fix-create-should-respect-exp-claim into 9e177c3 on master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants