From 274a61f2c463cd15936bf0adb6b23f24efe51136 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Wed, 27 Apr 2022 23:19:15 +0300 Subject: [PATCH] feat: update Tradeshift OAuth provider --- src/Appwrite/Auth/OAuth2/Spotify.php | 2 ++ src/Appwrite/Auth/OAuth2/Stripe.php | 3 ++- src/Appwrite/Auth/OAuth2/Tradeshift.php | 6 +++++- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/Appwrite/Auth/OAuth2/Spotify.php b/src/Appwrite/Auth/OAuth2/Spotify.php index 7509e271a7..d9f3589d0b 100644 --- a/src/Appwrite/Auth/OAuth2/Spotify.php +++ b/src/Appwrite/Auth/OAuth2/Spotify.php @@ -144,6 +144,8 @@ class Spotify extends OAuth2 /** * Check if the OAuth email is verified * + * Spotify does not assure that the email is verified + * * @link https://developer.spotify.com/documentation/web-api/reference/#/operations/get-current-users-profile * * @param $accessToken diff --git a/src/Appwrite/Auth/OAuth2/Stripe.php b/src/Appwrite/Auth/OAuth2/Stripe.php index 5cfceaacae..cf55156a14 100644 --- a/src/Appwrite/Auth/OAuth2/Stripe.php +++ b/src/Appwrite/Auth/OAuth2/Stripe.php @@ -144,7 +144,7 @@ class Stripe extends OAuth2 /** * Check if the OAuth email is verified * - * Stripe emails if present are verfied. + * Stripe emails if present are verfied. This was verified manually * * @param $accessToken * @@ -153,6 +153,7 @@ class Stripe extends OAuth2 public function isEmailVerififed(string $accessToken): bool { $email = $this->getUserEmail($accessToken); + return !empty($email); } diff --git a/src/Appwrite/Auth/OAuth2/Tradeshift.php b/src/Appwrite/Auth/OAuth2/Tradeshift.php index 968bc89b49..1aac40d934 100644 --- a/src/Appwrite/Auth/OAuth2/Tradeshift.php +++ b/src/Appwrite/Auth/OAuth2/Tradeshift.php @@ -144,13 +144,17 @@ class Tradeshift extends OAuth2 /** * Check if the OAuth email is verified * + * Tradeshift's signup process requires emails to be verified. This was verified manually + * * @param $accessToken * * @return bool */ public function isEmailVerififed(string $accessToken): bool { - return false; + $email = $this->getUser($accessToken); + + return !empty($email); } /**