From b810d52e590f510d9125820ce3b1d5895c0c0f8a Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Wed, 27 Apr 2022 23:39:11 +0300 Subject: [PATCH] feat: update Wordpress OAuth provider --- src/Appwrite/Auth/OAuth2/WordPress.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/Appwrite/Auth/OAuth2/WordPress.php b/src/Appwrite/Auth/OAuth2/WordPress.php index 4f9019f69d..03c1802834 100644 --- a/src/Appwrite/Auth/OAuth2/WordPress.php +++ b/src/Appwrite/Auth/OAuth2/WordPress.php @@ -134,12 +134,20 @@ class WordPress extends OAuth2 /** * Check if the OAuth email is verified * + * @link https://developer.wordpress.com/docs/api/1.1/get/me/ + * * @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; }