diff --git a/CHANGELOG.md b/CHANGELOG.md index 30aebc7..f27562f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ # CHANGELOG - Fix #307: Fix French translation (arollmann) - - Fix #316: Fix New Response from Google OAuth Api + - Fix #316: Fix new response from Google OAuth Api (Julian-B90) + - Fix #321: Fix new response from LinkedIn OAuth Api (tonydspaniard) ## 1.5.0 April 19, 2019 - Fix: Fix condition in EmailChangeService (it was always false) (borisaeric) diff --git a/src/User/AuthClient/LinkedIn.php b/src/User/AuthClient/LinkedIn.php index b99aa5b..b0fc422 100644 --- a/src/User/AuthClient/LinkedIn.php +++ b/src/User/AuthClient/LinkedIn.php @@ -21,9 +21,17 @@ class LinkedIn extends BaseLinkedIn implements AuthClientInterface */ public function getEmail() { - return isset($this->getUserAttributes()['email-address']) - ? $this->getUserAttributes()['email-address'] - : null; + $userAttributes = $this->getUserAttributes(); + + if (isset($userAttributes['email-address'])) { + return $userAttributes['email-address']; + } + + if (isset($userAttributes['email'])) { + return $userAttributes['email']; + } + + return null; } /**