1
0
Fork 0
mirror of synced 2024-06-29 11:40:45 +12:00

feat: added check for Auth0 OAuth

This commit is contained in:
Christy Jacob 2022-05-07 16:10:28 +04:00
parent b5717d749c
commit fa363a09ff

View file

@ -141,12 +141,20 @@ class Auth0 extends OAuth2
/**
* Check if the OAuth email is verified
*
* @link https://auth0.com/docs/api/authentication?javascript#user-profile
*
* @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;
}