From fa363a09ff96a28c6fa4839ed29d2721d17686e1 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Sat, 7 May 2022 16:10:28 +0400 Subject: [PATCH] feat: added check for Auth0 OAuth --- src/Appwrite/Auth/OAuth2/Auth0.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/Appwrite/Auth/OAuth2/Auth0.php b/src/Appwrite/Auth/OAuth2/Auth0.php index 44b07c3a06..ed16b04c08 100644 --- a/src/Appwrite/Auth/OAuth2/Auth0.php +++ b/src/Appwrite/Auth/OAuth2/Auth0.php @@ -141,12 +141,20 @@ class Auth0 extends OAuth2 /** * Check if the OAuth email is verified * + * @link https://auth0.com/docs/api/authentication?javascript#user-profile + * * @param $accessToken * * @return bool */ public function isEmailVerified(string $accessToken): bool { + $user = $this->getUser($accessToken); + + if (isset($user['email_verified']) && $user['email_verified'] === true) { + return true; + } + return false; }