Getting avatar in try catch block to avoid auto-login interruption when avatar is not found
This commit is contained in:
parent
55fb0c1430
commit
be44328ae2
|
@ -118,7 +118,12 @@ public class OpenIdConnectAutoLogin extends BaseAutoLogin {
|
||||||
UserLocalServiceUtil.updateUser(user);
|
UserLocalServiceUtil.updateUser(user);
|
||||||
}
|
}
|
||||||
|
|
||||||
byte[] userAvatar = OpenIdConnectRESTHelper.getUserAvatar(configuration.getAvatarURL(), token);
|
byte[] userAvatar = null;
|
||||||
|
try {
|
||||||
|
userAvatar = OpenIdConnectRESTHelper.getUserAvatar(configuration.getAvatarURL(), token);
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.info("Can't retrieve user's avatar from Keycloak: " + e.getLocalizedMessage());
|
||||||
|
}
|
||||||
if (userAvatar != null) {
|
if (userAvatar != null) {
|
||||||
UserServiceUtil.updatePortrait(user.getUserId(), userAvatar);
|
UserServiceUtil.updatePortrait(user.getUserId(), userAvatar);
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue