Using UserLocalServiceUtil to update the portrait to avoid `PrincipalException: PermissionChecker not initialized`
This commit is contained in:
parent
be44328ae2
commit
02ea26fc60
|
@ -125,9 +125,9 @@ public class OpenIdConnectAutoLogin extends BaseAutoLogin {
|
||||||
log.info("Can't retrieve user's avatar from Keycloak: " + e.getLocalizedMessage());
|
log.info("Can't retrieve user's avatar from Keycloak: " + e.getLocalizedMessage());
|
||||||
}
|
}
|
||||||
if (userAvatar != null) {
|
if (userAvatar != null) {
|
||||||
UserServiceUtil.updatePortrait(user.getUserId(), userAvatar);
|
UserLocalServiceUtil.updatePortrait(user.getUserId(), userAvatar);
|
||||||
} else {
|
} else {
|
||||||
UserServiceUtil.deletePortrait(user.getUserId());
|
UserLocalServiceUtil.deletePortrait(user.getUserId());
|
||||||
}
|
}
|
||||||
} catch (SystemException | PortalException e) {
|
} catch (SystemException | PortalException e) {
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
|
|
Loading…
Reference in New Issue