Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# nJwt Change Log

### 1.2.1

* Added support for skip validate the expiration of the token, use `nJwt.createVerifier().setIgnoreExpiration(true)`

### 1.2.0

* [#84] (https://github.com/jwtk/njwt/pull/84) Resolves `uuid` vulnerability.
Expand Down
6 changes: 5 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,10 @@ Verifier.prototype.setSigningKey = function setSigningKey(keyStr) {
Verifier.prototype.setKeyResolver = function setKeyResolver(keyResolver) {
this.keyResolver = keyResolver.bind(this);
};
Verifier.prototype.setIgnoreExpiration = function setIgnoreExpiration(ignoreExpiration) {
this.ignoreExpiration = ignoreExpiration;
return this;
};
Verifier.prototype.isSupportedAlg = isSupportedAlg;

Verifier.prototype.verify = function verify(jwtString,cb){
Expand All @@ -362,7 +366,7 @@ Verifier.prototype.verify = function verify(jwtString,cb){
return done(new JwtParseError(properties.errors.SIGNATURE_ALGORITHM_MISMTACH,jwtString,header,body));
}

if (jwt.isExpired()) {
if (!this.ignoreExpiration && jwt.isExpired()) {
return done(new JwtParseError(properties.errors.EXPIRED,jwtString,header,body));
}

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "njwt",
"version": "1.2.0",
"version": "1.2.1",
"description": "JWT Library for Node.js",
"engines": {
"node": ">=6.0"
Expand Down