Skip to content

Commit

Permalink
[ALS-4793] Add logging. Minor refactor.
Browse files Browse the repository at this point in the history
  • Loading branch information
Gcolon021 committed Aug 7, 2023
1 parent 4698cad commit dc87083
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,11 @@ public User createOpenAccessUser() {
result.setEmail(user.getUuid() + "@open_access.com");
em().merge(result);

logger.info("createOpenAccessUser() created user, uuid: " + result.getUuid()
+ ", subject: " + result.getSubject()
+ ", role: " + result.getRoleString()
+ ", privilege: "+ result.getPrivilegeString()
+ ", email: " + result.getEmail());
return result;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,9 @@ public HashMap<String, String> getUserProfileResponse(Map<String, Object> claims

logger.debug("getUserProfileResponse() acceptedTOS is set");

boolean acceptedTOS = JAXRSConfiguration.tosEnabled.startsWith("true") ?
tosService.getLatest() == null || tosService.hasUserAcceptedLatest(claims.get("subject").toString()) : true;
boolean acceptedTOS = !JAXRSConfiguration.tosEnabled.startsWith("true") || tosService.getLatest() == null || tosService.hasUserAcceptedLatest(claims.get("subject").toString());

responseMap.put("acceptedTOS", ""+acceptedTOS);
responseMap.put("acceptedTOS", String.valueOf(acceptedTOS));

logger.debug("getUserProfileResponse() expirationDate is set");
Date expirationDate = new Date(Calendar.getInstance().getTimeInMillis() + JAXRSConfiguration.tokenExpirationTime);
Expand Down

0 comments on commit dc87083

Please sign in to comment.