From d0fa65dee0cbd1b231d857e6e163388a05ab7217 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Thu, 5 May 2022 20:17:29 +0400 Subject: [PATCH] feat: added check for Gitlab OAuth --- src/Appwrite/Auth/OAuth2/Gitlab.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/Appwrite/Auth/OAuth2/Gitlab.php b/src/Appwrite/Auth/OAuth2/Gitlab.php index ee898e251..ed0515d0a 100644 --- a/src/Appwrite/Auth/OAuth2/Gitlab.php +++ b/src/Appwrite/Auth/OAuth2/Gitlab.php @@ -130,12 +130,20 @@ class Gitlab extends OAuth2 /** * Check if the OAuth email is verified * + * @link https://docs.gitlab.com/ee/api/users.html#list-current-user-for-normal-users + * * @param $accessToken * * @return bool */ public function isEmailVerified(string $accessToken): bool { + $user = $this->getUser($accessToken); + + if (isset($user['confirmed_at']) && $user['confirmed_at'] !== null) { + return true; + } + return false; }