diff --git a/src/Appwrite/Auth/OAuth2.php b/src/Appwrite/Auth/OAuth2.php index d7c1c99546..28de8dd914 100644 --- a/src/Appwrite/Auth/OAuth2.php +++ b/src/Appwrite/Auth/OAuth2.php @@ -73,6 +73,13 @@ abstract class OAuth2 */ abstract public function refreshTokens(string $refreshToken): array; + /** + * @param string $accessToken + * + * @return string + */ + abstract public function getUserID(string $accessToken): string; + /** * @param string $accessToken * @@ -148,11 +155,11 @@ abstract class OAuth2 * * @return string */ - public function getAccessTokenExpiry(string $code): string + public function getAccessTokenExpiry(string $code): int { $tokens = $this->getTokens($code); - return $tokens['expires_in'] ?? ''; + return $tokens['expires_in'] ?? 0; } // The parseState function was designed specifically for Amazon OAuth2 Adapter to override.