Skip to content

Commit

Permalink
Add condition check before evicting cache
Browse files Browse the repository at this point in the history
  • Loading branch information
Gcolon021 committed Jul 8, 2024
1 parent 6f30645 commit c090d63
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,10 @@ public HashMap<String, String> authenticate(Map<String, String> authRequest, Str
current_user = createUserFromFENCEProfile(fence_user_profile);
logger.info("getFENCEProfile() saved details for user with e-mail:{} and subject:{}", current_user.getEmail(), current_user.getSubject());

accessRuleService.evictFromCache(current_user);
userService.evictFromCache(current_user);
if (!current_user.getEmail().isEmpty()) {
accessRuleService.evictFromCache(current_user);
userService.evictFromCache(current_user);
}
} catch (Exception ex) {
logger.error("getFENCEToken() Could not persist the user information, because {}", ex.getMessage());
throw new NotAuthorizedException("The user details could not be persisted. Please contact the administrator.");
Expand Down

0 comments on commit c090d63

Please sign in to comment.