Added save and delete portrait log messages

This commit is contained in:
Mauro Mugnaini 2020-08-13 17:46:19 +02:00
parent 02ea26fc60
commit f272b680ed
1 changed files with 3 additions and 1 deletions

View File

@ -122,11 +122,13 @@ public class OpenIdConnectAutoLogin extends BaseAutoLogin {
try {
userAvatar = OpenIdConnectRESTHelper.getUserAvatar(configuration.getAvatarURL(), token);
} catch (Exception e) {
log.info("Can't retrieve user's avatar from Keycloak: " + e.getLocalizedMessage());
log.debug("Can't retrieve user's avatar from Keycloak: " + e.getLocalizedMessage());
}
if (userAvatar != null) {
log.debug("Saving the retrieved avatar as user's portrait");
UserLocalServiceUtil.updatePortrait(user.getUserId(), userAvatar);
} else {
log.debug("Deleting the user's portrait since no avatar has been found for the user");
UserLocalServiceUtil.deletePortrait(user.getUserId());
}
} catch (SystemException | PortalException e) {