diff --git a/src/Appwrite/Auth/OAuth2/Gitea.php b/src/Appwrite/Auth/OAuth2/Gitea.php index 1cc891c167..390189fc72 100644 --- a/src/Appwrite/Auth/OAuth2/Gitea.php +++ b/src/Appwrite/Auth/OAuth2/Gitea.php @@ -14,11 +14,6 @@ class Gitea extends OAuth2 protected array $scopes = [ 'read:user', - 'read:repository', - 'write:repository', - 'read:organization', - 'read:issue', - 'write:issue', ]; public function setEndpoint(string $endpoint): void diff --git a/src/Appwrite/Platform/Modules/VCS/Http/Gitea/Authorize/Get.php b/src/Appwrite/Platform/Modules/VCS/Http/Gitea/Authorize/Get.php index e77d2267ec..efeef8fc3a 100644 --- a/src/Appwrite/Platform/Modules/VCS/Http/Gitea/Authorize/Get.php +++ b/src/Appwrite/Platform/Modules/VCS/Http/Gitea/Authorize/Get.php @@ -30,7 +30,16 @@ class Get extends Base System::getEnv('_APP_VCS_GITEA_CLIENT_ID', ''), System::getEnv('_APP_VCS_GITEA_CLIENT_SECRET', ''), $callback, - $state + $state, + // VCS-specific scopes -- the adapter's own default is just + // read:user, enough for a plain "sign in with Gitea". + [ + 'read:repository', + 'write:repository', + 'read:organization', + 'read:issue', + 'write:issue', + ] ); // The login page is opened by the browser, which may reach Gitea on a