Skip to content
This repository has been archived by the owner on May 22, 2021. It is now read-only.

Commit

Permalink
Added check to avoid NullPointerException (#17)
Browse files Browse the repository at this point in the history
  • Loading branch information
PAException committed May 11, 2020
1 parent c899ff6 commit f1b3129
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion auth/src/main/java/com/gewia/common/auth/jwt/JwtUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ public Pair<DecodedJWT, VerificationResult> verify(String token) {
return Pair.of(null, VerificationResult.UNKNOWN);
}

if (jwt.getExpiresAt().before(Date.from(Instant.now()))) return Pair.of(jwt, VerificationResult.EXPIRED);
if (jwt.getExpiresAt() != null && jwt.getExpiresAt().before(Date.from(Instant.now())))
return Pair.of(jwt, VerificationResult.EXPIRED);

try {
jwt = verifier.verify(jwt);
Expand Down

0 comments on commit f1b3129

Please sign in to comment.