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

Do not set an expiration claim if it has already been defined by the user #52

Open
pingvinen opened this issue Jul 6, 2018 · 0 comments

Comments

@pingvinen
Copy link

I find it a little confusing that I have to do the following in order to set an expiration - am I just missing something?

const claims = {
	exp: expirationTimestampInSeconds
}
const jwt = njwt.create(claims, signingKey, 'HS256');
jwt.setExpiration(claims.exp * 1000); // this accepts milliseconds for some reason

return jwt.compact();

In create, why not skip the expiration setting part, if the claims already contains the exp claim?

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

No branches or pull requests

1 participant