Skip to content

Commit

Permalink
Add null handling for a missing expiresOn field.
Browse files Browse the repository at this point in the history
  • Loading branch information
brendandburns committed Aug 12, 2022
1 parent ad5b390 commit 55c304e
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ public String getToken(Map<String, Object> config) {
@Override
public boolean isExpired(Map<String, Object> config) {
String expiresOn = (String) config.get(EXPIRES_ON);
if (expiresOn == null || expiresOn.length() == 0) {
return true;
}
Date expiry = new Date(Long.parseLong(expiresOn) * 1000);
return expiry.compareTo(new Date()) <= 0;
}
Expand Down

0 comments on commit 55c304e

Please sign in to comment.