From 9035fd3f6f1d5bf512bdcaae915010865a513c3d Mon Sep 17 00:00:00 2001 From: harsh mahajan Date: Tue, 25 Aug 2026 17:22:21 +0530 Subject: [PATCH] feat(console): allow GitLab and Bitbucket sign-in to the console project The console project only ever defined a GitHub slot in its oAuthProviders, so createOAuth2Session for any other provider failed the `{provider}Enabled` check regardless of what credentials were configured - there was nowhere to put them. Adds GitLab and Bitbucket alongside GitHub, following the same `{provider}Enabled` / `{provider}Appid` / `{provider}Secret` key contract that app/controllers/api/account.php reads at sign-in. Unlike GitHub these are opt-in rather than unconditionally enabled: they advertise as enabled only once an app ID is present, so installs that haven't configured them report the provider as disabled rather than half-configured. Note the new _APP_CONSOLE_* variables are deliberately distinct from the existing _APP_VCS_* ones. Those power repository integration (installations, webhooks); console sign-in reads the project document's oAuthProviders, which is a separate credential pair. --- app/config/console.php | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/app/config/console.php b/app/config/console.php index bf1850182a..6a98b72e49 100644 --- a/app/config/console.php +++ b/app/config/console.php @@ -57,7 +57,18 @@ $console = [ 'oAuthProviders' => [ 'githubEnabled' => true, 'githubSecret' => System::getEnv('_APP_CONSOLE_GITHUB_SECRET', ''), - 'githubAppid' => System::getEnv('_APP_CONSOLE_GITHUB_APP_ID', '') + 'githubAppid' => System::getEnv('_APP_CONSOLE_GITHUB_APP_ID', ''), + // GitLab and Bitbucket are opt-in: unlike GitHub they are not assumed + // to be configured on every install, so they only advertise as enabled + // once credentials are actually present. Note these are distinct from + // the _APP_VCS_* credentials, which power repository integration + // (installations/webhooks) rather than console sign-in. + 'gitlabEnabled' => !empty(System::getEnv('_APP_CONSOLE_GITLAB_APP_ID', '')), + 'gitlabSecret' => System::getEnv('_APP_CONSOLE_GITLAB_SECRET', ''), + 'gitlabAppid' => System::getEnv('_APP_CONSOLE_GITLAB_APP_ID', ''), + 'bitbucketEnabled' => !empty(System::getEnv('_APP_CONSOLE_BITBUCKET_APP_ID', '')), + 'bitbucketSecret' => System::getEnv('_APP_CONSOLE_BITBUCKET_SECRET', ''), + 'bitbucketAppid' => System::getEnv('_APP_CONSOLE_BITBUCKET_APP_ID', ''), ], 'smtpBaseTemplate' => APP_BRANDED_EMAIL_BASE_TEMPLATE, ];