mirror of
https://github.com/appwrite/appwrite
synced 2026-05-23 08:58:35 +00:00
Add types and missing function
This commit is contained in:
parent
2d6dcf976a
commit
c3ab01afd4
1 changed files with 23 additions and 4 deletions
|
|
@ -9,10 +9,10 @@ use Appwrite\Auth\OAuth2;
|
|||
|
||||
class Authentik extends OAuth2
|
||||
{
|
||||
/**
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
protected $scopes = [
|
||||
protected array $scopes = [
|
||||
'openid',
|
||||
'profile',
|
||||
'email',
|
||||
|
|
@ -22,12 +22,12 @@ class Authentik extends OAuth2
|
|||
/**
|
||||
* @var array
|
||||
*/
|
||||
protected $user = [];
|
||||
protected array $user = [];
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
protected $tokens = [];
|
||||
protected array $tokens = [];
|
||||
|
||||
/**
|
||||
* @return string
|
||||
|
|
@ -137,6 +137,25 @@ class Authentik extends OAuth2
|
|||
return '';
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if the User email is verified
|
||||
*
|
||||
*
|
||||
* @param string $accessToken
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function isEmailVerified(string $accessToken): bool
|
||||
{
|
||||
$user = $this->getUser($accessToken);
|
||||
|
||||
if ($user['email_verified'] ?? false) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $accessToken
|
||||
*
|
||||
|
|
|
|||
Loading…
Reference in a new issue