Skip to content

Commit

Permalink
fix(jans-auth-server): fixed NPE during getting AT lifetime #1233
Browse files Browse the repository at this point in the history
  • Loading branch information
yuriyz committed Jul 12, 2022
1 parent 023cf8a commit f8be086
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ public int getAccessTokenLifetimeInSeconds(ExecutionContext executionContext) {
log.trace("Override access token lifetime with value from script: {}", lifetimeFromScript);
}

if (client.isAccessTokenAsJwt() && appConfiguration.getKeyRegenerationEnabled()) {
if (client != null && client.isAccessTokenAsJwt() && appConfiguration.getKeyRegenerationEnabled()) {
int intervalInSeconds = appConfiguration.getKeyRegenerationInterval() * 3600;
int timePassedInSeconds = (int) ((System.currentTimeMillis() - keyGeneratorTimer.getLastFinishedTime()) / 1000);
final int recalculcatedLifetime = intervalInSeconds - timePassedInSeconds;
Expand Down

0 comments on commit f8be086

Please sign in to comment.