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.
This commit is contained in:
harsh mahajan committed 2026-08-25 17:22:21 +05:30
1 parent a6782899a6
commit 9035fd3f6f
1 file changed
+12 -1
+12 -1
View File
@@ -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,
];