feat: added check for Gitlab OAuth
This commit is contained in:
parent
e2db8faaf3
commit
d0fa65dee0
1 changed files with 8 additions and 0 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue