mirror of
https://github.com/BookStackApp/BookStack.git
synced 2026-01-03 23:42:28 +03:00
OIDC: Updated avatar fetching to run on each login
But only where the user does not already have an avatar assigned. This aligns with the LDAP avatar fetching logic.
This commit is contained in:
@@ -222,9 +222,7 @@ class OidcService
|
||||
throw new OidcException($exception->getMessage());
|
||||
}
|
||||
|
||||
// TODO - Update this (and tests and config option comments) to actually align with LDAP system
|
||||
// which syncs whenever on login or registration, where there's no existing avatar.
|
||||
if ($this->config()['fetch_avatar'] && $user->wasRecentlyCreated && $userDetails->picture) {
|
||||
if ($this->config()['fetch_avatar'] && !$user->avatar()->exists() && $userDetails->picture) {
|
||||
$this->userAvatars->assignToUserFromUrl($user, $userDetails->picture);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user