Skip to content

Commit

Permalink
Updated with review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
veerasekharbab.golla committed Jan 12, 2019
1 parent a530799 commit 39ec032
Showing 1 changed file with 16 additions and 15 deletions.
31 changes: 16 additions & 15 deletions lib/src/main/java/com/auth0/jwt/JWTVerifier.java
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ public Verification acceptIssuedAt(long leeway) throws IllegalArgumentException
}

/**
* Call this method to skip the default issued_at verification
* Skip the Issued At ("iat") date verification. By default, the verification is performed.
*/
public Verification ignoreIssuedAt() {
this.ignoreIssuedAt = true;
Expand Down Expand Up @@ -325,20 +325,21 @@ private void assertNonNull(String name) {
}
}

private void addLeewayToDateClaims() {
if (!claims.containsKey(PublicClaims.EXPIRES_AT)) {
claims.put(PublicClaims.EXPIRES_AT, defaultLeeway);
}
if (!claims.containsKey(PublicClaims.NOT_BEFORE)) {
claims.put(PublicClaims.NOT_BEFORE, defaultLeeway);
}
if (!claims.containsKey(PublicClaims.ISSUED_AT)) {
claims.put(PublicClaims.ISSUED_AT, defaultLeeway);
}
if(ignoreIssuedAt) {
claims.remove(PublicClaims.ISSUED_AT);
}
}
private void addLeewayToDateClaims() {
if (!claims.containsKey(PublicClaims.EXPIRES_AT)) {
claims.put(PublicClaims.EXPIRES_AT, defaultLeeway);
}
if (!claims.containsKey(PublicClaims.NOT_BEFORE)) {
claims.put(PublicClaims.NOT_BEFORE, defaultLeeway);
}
if(ignoreIssuedAt) {
claims.remove(PublicClaims.ISSUED_AT);
return;
}
if (!claims.containsKey(PublicClaims.ISSUED_AT)) {
claims.put(PublicClaims.ISSUED_AT, defaultLeeway);
}
}

private void requireClaim(String name, Object value) {
if (value == null) {
Expand Down

0 comments on commit 39ec032

Please sign in to comment.