change google OAuth response

This commit is contained in:
Julian Böhnke
2019-06-15 18:18:55 +02:00
parent d7573b181a
commit 12378e6fe7

View File

@ -21,9 +21,14 @@ class Google extends BaseGoogle implements AuthClientInterface
*/ */
public function getEmail() public function getEmail()
{ {
return isset($this->getUserAttributes()['emails'][0]['value']) $userAttributes = $this->getUserAttributes();
? $this->getUserAttributes()['emails'][0]['value'] if (isset($userAttributes['emails']) && isset($userAttributes['emails'][0]['value'])) {
: null; return $userAttributes['emails'][0]['value'];
} elseif (isset($userAttributes['email'])) {
return $userAttributes['email'];
}
return null;
} }
/** /**