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()
{
return isset($this->getUserAttributes()['emails'][0]['value'])
? $this->getUserAttributes()['emails'][0]['value']
: null;
$userAttributes = $this->getUserAttributes();
if (isset($userAttributes['emails']) && isset($userAttributes['emails'][0]['value'])) {
return $userAttributes['emails'][0]['value'];
} elseif (isset($userAttributes['email'])) {
return $userAttributes['email'];
}
return null;
}
/**