1
0
Fork 0
mirror of synced 2024-06-26 18:20:43 +12:00

feat: added check for Gitlab OAuth

This commit is contained in:
Christy Jacob 2022-05-05 20:17:29 +04:00
parent e2db8faaf3
commit d0fa65dee0

View file

@ -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;
}