From 7bf7db6e5fb09e172b3900ac8a995655a2f41837 Mon Sep 17 00:00:00 2001 From: tonydspaniard Date: Sun, 16 Jun 2019 13:22:54 +0200 Subject: [PATCH] re #318 slight modification to the code provided by @Julian-B90 --- src/User/AuthClient/Google.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/User/AuthClient/Google.php b/src/User/AuthClient/Google.php index a725978..42c2495 100644 --- a/src/User/AuthClient/Google.php +++ b/src/User/AuthClient/Google.php @@ -22,9 +22,12 @@ class Google extends BaseGoogle implements AuthClientInterface public function getEmail() { $userAttributes = $this->getUserAttributes(); - if (isset($userAttributes['emails']) && isset($userAttributes['emails'][0]['value'])) { + + if (isset($userAttributes['emails'][0]['value'])) { return $userAttributes['emails'][0]['value']; - } elseif (isset($userAttributes['email'])) { + } + + if (isset($userAttributes['email'])) { return $userAttributes['email']; }