diff --git a/CHANGELOG.md b/CHANGELOG.md index 1983320bb..d6e44a757 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,8 @@ * Added `Page::httpResponseCode()` and `Page::httpHeaders()` methods 1. [](#improved) * Added apcu autoloader optimization +1. [](#bugfix) + * Use login provider User avatar if set * Updated Grav `Processor` classes to implement PSR-15 `MiddlewareInterface` # v1.6.0-beta.3 diff --git a/system/src/Grav/Common/User/User.php b/system/src/Grav/Common/User/User.php index 438ca97a7..c5312ad75 100644 --- a/system/src/Grav/Common/User/User.php +++ b/system/src/Grav/Common/User/User.php @@ -282,6 +282,13 @@ class User extends Data $avatar = $this->avatar; $avatar = array_shift($avatar); return Grav::instance()['base_url'] . '/' . $avatar['path']; + } elseif ($this->provider) { + $provider = $this->provider; + if (isset($this->$provider['avatar_url'])) { + return $this->$provider['avatar_url']; + } elseif (isset($this->$provider['avatar'])) { + return $this->$provider['avatar']; + } } return 'https://www.gravatar.com/avatar/' . md5($this->email);