From 73fe35f2022bd478ff5518f9e98a9e39374b3f2c Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Fri, 29 Apr 2022 13:08:22 +0300 Subject: [PATCH] feat: update Apple OAuth provider --- src/Appwrite/Auth/OAuth2/Apple.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/Appwrite/Auth/OAuth2/Apple.php b/src/Appwrite/Auth/OAuth2/Apple.php index de438c988..7c6436f3c 100644 --- a/src/Appwrite/Auth/OAuth2/Apple.php +++ b/src/Appwrite/Auth/OAuth2/Apple.php @@ -136,10 +136,7 @@ class Apple extends OAuth2 */ public function getUserEmail(string $accessToken): string { - if (isset($this->claims['email']) && - !empty($this->claims['email']) && - isset($this->claims['email_verified']) && - $this->claims['email_verified'] === 'true') { + if (isset($this->claims['email']) && !empty($this->claims['email'])) { return $this->claims['email']; } @@ -149,12 +146,18 @@ class Apple extends OAuth2 /** * Check if the OAuth email is verified * + * @link https://developer.apple.com/forums/thread/121411 + * * @param $accessToken * * @return bool */ public function isEmailVerified(string $accessToken): bool { + if (isset($this->claims['email_verified']) && $this->claims['email_verified'] === 'true') { + return true; + } + return false; }