From 114e8300b7777a7d191987aa1294111564fac8b2 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Wed, 27 Apr 2022 23:25:28 +0300 Subject: [PATCH] feat: update Twitch OAuth provider --- src/Appwrite/Auth/OAuth2/Slack.php | 2 +- src/Appwrite/Auth/OAuth2/Stripe.php | 4 ++-- src/Appwrite/Auth/OAuth2/Tradeshift.php | 4 ++-- src/Appwrite/Auth/OAuth2/Twitch.php | 8 +++++++- 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/Appwrite/Auth/OAuth2/Slack.php b/src/Appwrite/Auth/OAuth2/Slack.php index f61c776d41..da09ad318a 100644 --- a/src/Appwrite/Auth/OAuth2/Slack.php +++ b/src/Appwrite/Auth/OAuth2/Slack.php @@ -131,7 +131,7 @@ class Slack extends OAuth2 /** * Check if the OAuth email is verified * - * In case of Slack, if an email is present, it is verified + * If present, the email is verified. This was verfied through a manual Slack sign up process * * @link https://slack.com/help/articles/207262907-Change-your-email-address * diff --git a/src/Appwrite/Auth/OAuth2/Stripe.php b/src/Appwrite/Auth/OAuth2/Stripe.php index cf55156a14..dc46974317 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. This was verified manually + * If present, the email is verified. This was verfied through a manual Stripe sign up process * * @param $accessToken * @@ -153,7 +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 1aac40d934..96339137c1 100644 --- a/src/Appwrite/Auth/OAuth2/Tradeshift.php +++ b/src/Appwrite/Auth/OAuth2/Tradeshift.php @@ -144,7 +144,7 @@ class Tradeshift extends OAuth2 /** * Check if the OAuth email is verified * - * Tradeshift's signup process requires emails to be verified. This was verified manually + * If present, the email is verified. This was verfied through a manual Tradeshift sign up process * * @param $accessToken * @@ -153,7 +153,7 @@ class Tradeshift extends OAuth2 public function isEmailVerififed(string $accessToken): bool { $email = $this->getUser($accessToken); - + return !empty($email); } diff --git a/src/Appwrite/Auth/OAuth2/Twitch.php b/src/Appwrite/Auth/OAuth2/Twitch.php index 4c8b35385d..73cd57ec75 100644 --- a/src/Appwrite/Auth/OAuth2/Twitch.php +++ b/src/Appwrite/Auth/OAuth2/Twitch.php @@ -143,13 +143,19 @@ class Twitch extends OAuth2 /** * Check if the OAuth email is verified * + * If present, the email is verified + * + * @link https://dev.twitch.tv/docs/api/reference#get-users + * * @param $accessToken * * @return bool */ public function isEmailVerififed(string $accessToken): bool { - return false; + $email = $this->getUserEmail($accessToken); + + return !empty($email); } /**