]> BookStack Code Mirror - bookstack/blobdiff - app/Access/Oidc/OidcService.php
OIDC: Updated avatar fetching to run on each login
[bookstack] / app / Access / Oidc / OidcService.php
index 38eecdff35c8b4f4df3a17d97e5b310173bea2ab..d6f6ef156e40020ba162b2f2bd00587d7afb74c5 100644 (file)
@@ -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);
         }