mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-07-30 04:23:11 +03:00
OIDC: Added testing coverage for picture fetching
This commit is contained in:
@ -222,6 +222,8 @@ 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) {
|
||||
$this->userAvatars->assignToUserFromUrl($user, $userDetails->picture);
|
||||
}
|
||||
|
@ -65,7 +65,7 @@ class UserAvatars
|
||||
|
||||
$mime = (new WebSafeMimeSniffer())->sniff($imageData);
|
||||
[$format, $type] = explode('/', $mime, 2);
|
||||
if ($format !== 'image' || ImageService::isExtensionSupported($type)) {
|
||||
if ($format !== 'image' || !ImageService::isExtensionSupported($type)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -45,6 +45,7 @@ use Illuminate\Support\Collection;
|
||||
* @property string $system_name
|
||||
* @property Collection $roles
|
||||
* @property Collection $mfaValues
|
||||
* @property ?Image $avatar
|
||||
*/
|
||||
class User extends Model implements AuthenticatableContract, CanResetPasswordContract, Loggable, Sluggable
|
||||
{
|
||||
|
Reference in New Issue
Block a user