From d52af8afa987fec16cfd8c03930aa0fe1931fb86 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Thu, 28 Apr 2022 10:44:09 +0300 Subject: [PATCH] feat: update Zoom & Amazon OAuth provider --- src/Appwrite/Auth/OAuth2/Amazon.php | 6 +++++- src/Appwrite/Auth/OAuth2/Zoom.php | 8 ++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/Appwrite/Auth/OAuth2/Amazon.php b/src/Appwrite/Auth/OAuth2/Amazon.php index c406817f36..edace5df6b 100644 --- a/src/Appwrite/Auth/OAuth2/Amazon.php +++ b/src/Appwrite/Auth/OAuth2/Amazon.php @@ -149,13 +149,17 @@ class Amazon extends OAuth2 /** * Check if the OAuth email is verified * + * If present, the email is verified. This was verfied through a manual Amazon sign up process + * * @param $accessToken * * @return bool */ public function isEmailVerified(string $accessToken): bool { - return false; + $email = $this->getUserEmail($accessToken); + + return !empty($email); } /** diff --git a/src/Appwrite/Auth/OAuth2/Zoom.php b/src/Appwrite/Auth/OAuth2/Zoom.php index 8d3987d7c6..a36c3e44c1 100644 --- a/src/Appwrite/Auth/OAuth2/Zoom.php +++ b/src/Appwrite/Auth/OAuth2/Zoom.php @@ -129,12 +129,20 @@ class Zoom extends OAuth2 /** * Check if the OAuth email is verified * + * @link https://marketplace.zoom.us/docs/api-reference/zoom-api/methods/#operation/user + * * @param $accessToken * * @return bool */ public function isEmailVerified(string $accessToken): bool { + $user = $this->getUser($accessToken); + + if (isset($user['verified']) && $user['verified'] === 1) { + return true; + } + return false; }