From e052999c748755e26c90210fc4896d201703bcdb Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Thu, 5 May 2022 14:53:18 +0400 Subject: [PATCH] feat: added check for Okta OAuth --- src/Appwrite/Auth/OAuth2/Okta.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/Appwrite/Auth/OAuth2/Okta.php b/src/Appwrite/Auth/OAuth2/Okta.php index cf74fc087..e806e04f3 100644 --- a/src/Appwrite/Auth/OAuth2/Okta.php +++ b/src/Appwrite/Auth/OAuth2/Okta.php @@ -141,12 +141,20 @@ class Okta extends OAuth2 /** * Check if the OAuth email is verified * + * @link https://developer.okta.com/docs/reference/api/oidc/#userinfo + * * @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; }