From dcaa89e75f04054b9521a17ade90e2502ed466ae Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Sat, 7 May 2022 14:47:45 +0400 Subject: [PATCH] feat: added check for Discord OAuth --- src/Appwrite/Auth/OAuth2/Discord.php | 8 ++++++++ src/Appwrite/Auth/OAuth2/Dropbox.php | 2 ++ 2 files changed, 10 insertions(+) diff --git a/src/Appwrite/Auth/OAuth2/Discord.php b/src/Appwrite/Auth/OAuth2/Discord.php index 033150d04..631f4a3f7 100644 --- a/src/Appwrite/Auth/OAuth2/Discord.php +++ b/src/Appwrite/Auth/OAuth2/Discord.php @@ -144,12 +144,20 @@ class Discord extends OAuth2 /** * Check if the OAuth email is verified * + * @link https://discord.com/developers/docs/resources/user + * * @param $accessToken * * @return bool */ public function isEmailVerified(string $accessToken): bool { + $user = $this->getUser($accessToken); + + if (isset($user['verified']) && $user['verified'] === true) { + return true; + } + return false; } diff --git a/src/Appwrite/Auth/OAuth2/Dropbox.php b/src/Appwrite/Auth/OAuth2/Dropbox.php index c29b3ccb7..04a07f486 100644 --- a/src/Appwrite/Auth/OAuth2/Dropbox.php +++ b/src/Appwrite/Auth/OAuth2/Dropbox.php @@ -134,6 +134,8 @@ class Dropbox extends OAuth2 /** * Check if the OAuth email is verified * + * @link https://www.dropbox.com/developers/documentation/http/documentation#users-get_current_account + * * @param $accessToken * * @return bool