diff --git a/src/Appwrite/Auth/OAuth2.php b/src/Appwrite/Auth/OAuth2.php index 4eafba7610..5ef4263833 100644 --- a/src/Appwrite/Auth/OAuth2.php +++ b/src/Appwrite/Auth/OAuth2.php @@ -52,54 +52,54 @@ abstract class OAuth2 /** * @return string */ - abstract public function getName():string; + abstract public function getName(): string; /** * @return string */ - abstract public function getLoginURL():string; + abstract public function getLoginURL(): string; /** * @param string $code * * @return array */ - abstract protected function getTokens(string $code):array; + abstract protected function getTokens(string $code): array; /** * @param string $refreshToken * * @return array */ - abstract public function refreshTokens(string $refreshToken):array; + abstract public function refreshTokens(string $refreshToken): array; /** * @param $accessToken * * @return string */ - abstract public function getUserID(string $accessToken):string; + abstract public function getUserEmail(string $accessToken): string; + + /** + * Is the OAuth email verified? + * + * @return bool + */ + abstract public function isEmailVerififed(): bool; /** * @param $accessToken * * @return string */ - abstract public function getUserEmail(string $accessToken):string; - - /** - * @param $accessToken - * - * @return string - */ - abstract public function getUserName(string $accessToken):string; + abstract public function getUserName(string $accessToken): string; /** * @param $scope * * @return $this */ - protected function addScope(string $scope):OAuth2 + protected function addScope(string $scope): OAuth2 { // Add a scope to the scopes array if it isn't already present if (!\in_array($scope, $this->scopes)) { @@ -111,7 +111,7 @@ abstract class OAuth2 /** * @return array */ - protected function getScopes():array + protected function getScopes(): array { return $this->scopes; } @@ -121,7 +121,7 @@ abstract class OAuth2 * * @return string */ - public function getAccessToken(string $code):string + public function getAccessToken(string $code): string { $tokens = $this->getTokens($code); return $tokens['access_token'] ?? ''; @@ -132,7 +132,7 @@ abstract class OAuth2 * * @return string */ - public function getRefreshToken(string $code):string + public function getRefreshToken(string $code): string { $tokens = $this->getTokens($code); return $tokens['refresh_token'] ?? ''; @@ -143,7 +143,7 @@ abstract class OAuth2 * * @return string */ - public function getAccessTokenExpiry(string $code):string + public function getAccessTokenExpiry(string $code): string { $tokens = $this->getTokens($code); return $tokens['expires_in'] ?? ''; @@ -170,7 +170,7 @@ abstract class OAuth2 * * @return string */ - protected function request(string $method, string $url = '', array $headers = [], string $payload = ''):string + protected function request(string $method, string $url = '', array $headers = [], string $payload = ''): string { $ch = \curl_init($url); diff --git a/src/Appwrite/Auth/OAuth2/Amazon.php b/src/Appwrite/Auth/OAuth2/Amazon.php index 7ec2769c9a..7b8cf6dbb0 100644 --- a/src/Appwrite/Auth/OAuth2/Amazon.php +++ b/src/Appwrite/Auth/OAuth2/Amazon.php @@ -146,6 +146,16 @@ class Amazon extends OAuth2 return ''; } + /** + * Is the OAuth email verified? + * + * @return bool + */ + public function isEmailVerififed(): bool + { + return false; + } + /** * @param string $accessToken * diff --git a/src/Appwrite/Auth/OAuth2/Apple.php b/src/Appwrite/Auth/OAuth2/Apple.php index f1ff4b724d..c380f7b6a7 100644 --- a/src/Appwrite/Auth/OAuth2/Apple.php +++ b/src/Appwrite/Auth/OAuth2/Apple.php @@ -146,6 +146,16 @@ class Apple extends OAuth2 return ''; } + /** + * Is the OAuth email verified? + * + * @return bool + */ + public function isEmailVerififed(): bool + { + return false; + } + /** * @param string $accessToken * diff --git a/src/Appwrite/Auth/OAuth2/Bitbucket.php b/src/Appwrite/Auth/OAuth2/Bitbucket.php index 74d684c845..5d6c6430d9 100644 --- a/src/Appwrite/Auth/OAuth2/Bitbucket.php +++ b/src/Appwrite/Auth/OAuth2/Bitbucket.php @@ -130,6 +130,16 @@ class Bitbucket extends OAuth2 return ''; } + /** + * Is the OAuth email verified? + * + * @return bool + */ + public function isEmailVerififed(): bool + { + return false; + } + /** * @param string $accessToken * diff --git a/src/Appwrite/Auth/OAuth2/Bitly.php b/src/Appwrite/Auth/OAuth2/Bitly.php index 02a21dc29e..a2d72b492d 100644 --- a/src/Appwrite/Auth/OAuth2/Bitly.php +++ b/src/Appwrite/Auth/OAuth2/Bitly.php @@ -148,6 +148,16 @@ class Bitly extends OAuth2 return ''; } + /** + * Is the OAuth email verified? + * + * @return bool + */ + public function isEmailVerififed(): bool + { + return false; + } + /** * @param $accessToken * diff --git a/src/Appwrite/Auth/OAuth2/Box.php b/src/Appwrite/Auth/OAuth2/Box.php index 80d59e9198..a6a1aa27d8 100644 --- a/src/Appwrite/Auth/OAuth2/Box.php +++ b/src/Appwrite/Auth/OAuth2/Box.php @@ -147,6 +147,16 @@ class Box extends OAuth2 return ''; } + /** + * Is the OAuth email verified? + * + * @return bool + */ + public function isEmailVerififed(): bool + { + return false; + } + /** * @param string $accessToken * diff --git a/src/Appwrite/Auth/OAuth2/Discord.php b/src/Appwrite/Auth/OAuth2/Discord.php index dece646e55..7c31c01e71 100644 --- a/src/Appwrite/Auth/OAuth2/Discord.php +++ b/src/Appwrite/Auth/OAuth2/Discord.php @@ -141,6 +141,16 @@ class Discord extends OAuth2 return ''; } + /** + * Is the OAuth email verified? + * + * @return bool + */ + public function isEmailVerififed(): bool + { + return false; + } + /** * @param string $accessToken * diff --git a/src/Appwrite/Auth/OAuth2/Dropbox.php b/src/Appwrite/Auth/OAuth2/Dropbox.php index f67e10b01d..ea6a9c8fce 100644 --- a/src/Appwrite/Auth/OAuth2/Dropbox.php +++ b/src/Appwrite/Auth/OAuth2/Dropbox.php @@ -131,6 +131,16 @@ class Dropbox extends OAuth2 return ''; } + /** + * Is the OAuth email verified? + * + * @return bool + */ + public function isEmailVerififed(): bool + { + return false; + } + /** * @param string $accessToken * diff --git a/src/Appwrite/Auth/OAuth2/Facebook.php b/src/Appwrite/Auth/OAuth2/Facebook.php index 7759a54042..f4e3c54541 100644 --- a/src/Appwrite/Auth/OAuth2/Facebook.php +++ b/src/Appwrite/Auth/OAuth2/Facebook.php @@ -129,6 +129,16 @@ class Facebook extends OAuth2 return ''; } + /** + * Is the OAuth email verified? + * + * @return bool + */ + public function isEmailVerififed(): bool + { + return false; + } + /** * @param string $accessToken * diff --git a/src/Appwrite/Auth/OAuth2/Github.php b/src/Appwrite/Auth/OAuth2/Github.php index dddd4a5181..4ca85f2b13 100644 --- a/src/Appwrite/Auth/OAuth2/Github.php +++ b/src/Appwrite/Auth/OAuth2/Github.php @@ -137,6 +137,16 @@ class Github extends OAuth2 return ''; } + /** + * Is the OAuth email verified? + * + * @return bool + */ + public function isEmailVerififed(): bool + { + return false; + } + /** * @param $accessToken * diff --git a/src/Appwrite/Auth/OAuth2/Gitlab.php b/src/Appwrite/Auth/OAuth2/Gitlab.php index 19ee1363a7..39c827389a 100644 --- a/src/Appwrite/Auth/OAuth2/Gitlab.php +++ b/src/Appwrite/Auth/OAuth2/Gitlab.php @@ -127,6 +127,16 @@ class Gitlab extends OAuth2 return ''; } + /** + * Is the OAuth email verified? + * + * @return bool + */ + public function isEmailVerififed(): bool + { + return false; + } + /** * @param string $accessToken * diff --git a/src/Appwrite/Auth/OAuth2/Google.php b/src/Appwrite/Auth/OAuth2/Google.php index 5b3ab938b3..b91fd91bee 100644 --- a/src/Appwrite/Auth/OAuth2/Google.php +++ b/src/Appwrite/Auth/OAuth2/Google.php @@ -137,6 +137,16 @@ class Google extends OAuth2 return ''; } + /** + * Is the OAuth email verified? + * + * @return bool + */ + public function isEmailVerififed(): bool + { + return false; + } + /** * @param string $accessToken * diff --git a/src/Appwrite/Auth/OAuth2/Linkedin.php b/src/Appwrite/Auth/OAuth2/Linkedin.php index 2519859a1b..577426e96b 100644 --- a/src/Appwrite/Auth/OAuth2/Linkedin.php +++ b/src/Appwrite/Auth/OAuth2/Linkedin.php @@ -148,6 +148,16 @@ class Linkedin extends OAuth2 return ''; } + /** + * Is the OAuth email verified? + * + * @return bool + */ + public function isEmailVerififed(): bool + { + return false; + } + /** * @param $accessToken * diff --git a/src/Appwrite/Auth/OAuth2/Microsoft.php b/src/Appwrite/Auth/OAuth2/Microsoft.php index ebfd2e4e83..bc4ea55b51 100644 --- a/src/Appwrite/Auth/OAuth2/Microsoft.php +++ b/src/Appwrite/Auth/OAuth2/Microsoft.php @@ -137,6 +137,16 @@ class Microsoft extends OAuth2 return ''; } + /** + * Is the OAuth email verified? + * + * @return bool + */ + public function isEmailVerififed(): bool + { + return false; + } + /** * @param string $accessToken * diff --git a/src/Appwrite/Auth/OAuth2/Mock.php b/src/Appwrite/Auth/OAuth2/Mock.php index aef92dac23..494674dfb6 100644 --- a/src/Appwrite/Auth/OAuth2/Mock.php +++ b/src/Appwrite/Auth/OAuth2/Mock.php @@ -130,6 +130,16 @@ class Mock extends OAuth2 return ''; } + /** + * Is the OAuth email verified? + * + * @return bool + */ + public function isEmailVerififed(): bool + { + return true; + } + /** * @param string $accessToken * diff --git a/src/Appwrite/Auth/OAuth2/Notion.php b/src/Appwrite/Auth/OAuth2/Notion.php index 5c117caa3c..0a293e3c4d 100644 --- a/src/Appwrite/Auth/OAuth2/Notion.php +++ b/src/Appwrite/Auth/OAuth2/Notion.php @@ -134,6 +134,16 @@ class Notion extends OAuth2 return ''; } + /** + * Is the OAuth email verified? + * + * @return bool + */ + public function isEmailVerififed(): bool + { + return false; + } + /** * @param $accessToken * diff --git a/src/Appwrite/Auth/OAuth2/Paypal.php b/src/Appwrite/Auth/OAuth2/Paypal.php index 39544c6bd8..e4e1bb626f 100644 --- a/src/Appwrite/Auth/OAuth2/Paypal.php +++ b/src/Appwrite/Auth/OAuth2/Paypal.php @@ -154,6 +154,16 @@ class Paypal extends OAuth2 return ''; } + /** + * Is the OAuth email verified? + * + * @return bool + */ + public function isEmailVerififed(): bool + { + return false + } + /** * @param string $accessToken * diff --git a/src/Appwrite/Auth/OAuth2/Salesforce.php b/src/Appwrite/Auth/OAuth2/Salesforce.php index 04ef1901b5..167629a497 100644 --- a/src/Appwrite/Auth/OAuth2/Salesforce.php +++ b/src/Appwrite/Auth/OAuth2/Salesforce.php @@ -148,6 +148,16 @@ class Salesforce extends OAuth2 return ''; } + /** + * Is the OAuth email verified? + * + * @return bool + */ + public function isEmailVerififed(): bool + { + return false; + } + /** * @param string $accessToken * diff --git a/src/Appwrite/Auth/OAuth2/Slack.php b/src/Appwrite/Auth/OAuth2/Slack.php index 92c210151b..f11d9fb653 100644 --- a/src/Appwrite/Auth/OAuth2/Slack.php +++ b/src/Appwrite/Auth/OAuth2/Slack.php @@ -128,6 +128,16 @@ class Slack extends OAuth2 return ''; } + /** + * Is the OAuth email verified? + * + * @return bool + */ + public function isEmailVerififed(): bool + { + return false; + } + /** * @param string $accessToken * diff --git a/src/Appwrite/Auth/OAuth2/Spotify.php b/src/Appwrite/Auth/OAuth2/Spotify.php index 5c1a43299a..ac21b6161b 100644 --- a/src/Appwrite/Auth/OAuth2/Spotify.php +++ b/src/Appwrite/Auth/OAuth2/Spotify.php @@ -141,6 +141,16 @@ class Spotify extends OAuth2 return ''; } + /** + * Is the OAuth email verified? + * + * @return bool + */ + public function isEmailVerififed(): bool + { + return false; + } + /** * @param $accessToken * diff --git a/src/Appwrite/Auth/OAuth2/Stripe.php b/src/Appwrite/Auth/OAuth2/Stripe.php index 589e6b7b81..35e01c6c87 100644 --- a/src/Appwrite/Auth/OAuth2/Stripe.php +++ b/src/Appwrite/Auth/OAuth2/Stripe.php @@ -141,6 +141,16 @@ class Stripe extends OAuth2 return $user['email'] ?? ''; } + /** + * Is the OAuth email verified? + * + * @return bool + */ + public function isEmailVerififed(): bool + { + return false; + } + /** * @param $accessToken * diff --git a/src/Appwrite/Auth/OAuth2/Tradeshift.php b/src/Appwrite/Auth/OAuth2/Tradeshift.php index 38b58432a0..b2a9720c89 100644 --- a/src/Appwrite/Auth/OAuth2/Tradeshift.php +++ b/src/Appwrite/Auth/OAuth2/Tradeshift.php @@ -141,6 +141,16 @@ class Tradeshift extends OAuth2 return $user['Username'] ?? ''; } + /** + * Is the OAuth email verified? + * + * @return bool + */ + public function isEmailVerififed(): bool + { + return false; + } + /** * @param string $accessToken * diff --git a/src/Appwrite/Auth/OAuth2/Twitch.php b/src/Appwrite/Auth/OAuth2/Twitch.php index 0deeb088e2..befaeefc14 100644 --- a/src/Appwrite/Auth/OAuth2/Twitch.php +++ b/src/Appwrite/Auth/OAuth2/Twitch.php @@ -140,6 +140,16 @@ class Twitch extends OAuth2 return ''; } + /** + * Is the OAuth email verified? + * + * @return bool + */ + public function isEmailVerififed(): bool + { + return false; + } + /** * @param $accessToken * diff --git a/src/Appwrite/Auth/OAuth2/Vk.php b/src/Appwrite/Auth/OAuth2/Vk.php index 5e54b14394..6bcd9b1691 100644 --- a/src/Appwrite/Auth/OAuth2/Vk.php +++ b/src/Appwrite/Auth/OAuth2/Vk.php @@ -150,6 +150,16 @@ class Vk extends OAuth2 return ''; } + /** + * Is the OAuth email verified? + * + * @return bool + */ + public function isEmailVerififed(): bool + { + return false; + } + /** * @param string $accessToken * diff --git a/src/Appwrite/Auth/OAuth2/WordPress.php b/src/Appwrite/Auth/OAuth2/WordPress.php index 5b957d9495..c394a96552 100644 --- a/src/Appwrite/Auth/OAuth2/WordPress.php +++ b/src/Appwrite/Auth/OAuth2/WordPress.php @@ -131,6 +131,16 @@ class WordPress extends OAuth2 return ''; } + /** + * Is the OAuth email verified? + * + * @return bool + */ + public function isEmailVerififed(): bool + { + return false; + } + /** * @param $accessToken * diff --git a/src/Appwrite/Auth/OAuth2/Yahoo.php b/src/Appwrite/Auth/OAuth2/Yahoo.php index ffefbe9c63..b6650cb739 100644 --- a/src/Appwrite/Auth/OAuth2/Yahoo.php +++ b/src/Appwrite/Auth/OAuth2/Yahoo.php @@ -161,6 +161,16 @@ class Yahoo extends OAuth2 return ''; } + /** + * Is the OAuth email verified? + * + * @return bool + */ + public function isEmailVerififed(): bool + { + return false; + } + /** * @param $accessToken * diff --git a/src/Appwrite/Auth/OAuth2/Yammer.php b/src/Appwrite/Auth/OAuth2/Yammer.php index 6e9f4fb86b..97e6f5e133 100644 --- a/src/Appwrite/Auth/OAuth2/Yammer.php +++ b/src/Appwrite/Auth/OAuth2/Yammer.php @@ -130,6 +130,16 @@ class Yammer extends OAuth2 return ''; } + /** + * Is the OAuth email verified? + * + * @return bool + */ + public function isEmailVerififed(): bool + { + return false; + } + /** * @param string $accessToken * diff --git a/src/Appwrite/Auth/OAuth2/Yandex.php b/src/Appwrite/Auth/OAuth2/Yandex.php index 1f6dda0d1b..4aa4a93cfe 100644 --- a/src/Appwrite/Auth/OAuth2/Yandex.php +++ b/src/Appwrite/Auth/OAuth2/Yandex.php @@ -144,6 +144,16 @@ class Yandex extends OAuth2 return ''; } + /** + * Is the OAuth email verified? + * + * @return bool + */ + public function isEmailVerififed(): bool + { + return false; + } + /** * @param string $accessToken * diff --git a/src/Appwrite/Auth/OAuth2/Zoom.php b/src/Appwrite/Auth/OAuth2/Zoom.php index 9aa77ceb91..f0f322e571 100644 --- a/src/Appwrite/Auth/OAuth2/Zoom.php +++ b/src/Appwrite/Auth/OAuth2/Zoom.php @@ -126,6 +126,16 @@ class Zoom extends OAuth2 return $response['email'] ?? ''; } + /** + * Is the OAuth email verified? + * + * @return bool + */ + public function isEmailVerififed(): bool + { + return false; + } + /** * @param $accessToken *