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

feat: update Apple OAuth provider

This commit is contained in:
Christy Jacob 2022-04-29 13:08:22 +03:00
parent d52af8afa9
commit 73fe35f202

View file

@ -136,10 +136,7 @@ class Apple extends OAuth2
*/
public function getUserEmail(string $accessToken): string
{
if (isset($this->claims['email']) &&
!empty($this->claims['email']) &&
isset($this->claims['email_verified']) &&
$this->claims['email_verified'] === 'true') {
if (isset($this->claims['email']) && !empty($this->claims['email'])) {
return $this->claims['email'];
}
@ -149,12 +146,18 @@ class Apple extends OAuth2
/**
* Check if the OAuth email is verified
*
* @link https://developer.apple.com/forums/thread/121411
*
* @param $accessToken
*
* @return bool
*/
public function isEmailVerified(string $accessToken): bool
{
if (isset($this->claims['email_verified']) && $this->claims['email_verified'] === 'true') {
return true;
}
return false;
}