Skip to content
Closed
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion Presenters/LoginPresenter.php
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,13 @@ public function GetKeycloakUrl()
public function GetOauth2Url()
{
// Retrieve Oauth2 configuration values
$baseUrl = rtrim(Configuration::Instance()->GetKey(ConfigKeys::AUTHENTICATION_OAUTH2_URL_AUTHORIZE), '/');
$trailingSlash = Configuration::Instance()->GetKey(ConfigKeys::AUTHENTICATION_OAUTH2_TRAILING_SLASH);
if (!$trailingSlash){
$baseUrl = rtrim(Configuration::Instance()->GetKey(ConfigKeys::AUTHENTICATION_OAUTH2_URL_AUTHORIZE), '/');
}
else {
Copy link

Copilot AI Mar 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code style is inconsistent with the rest of this file: if (!$trailingSlash){ is missing a space before {, and the else is on a new line (elsewhere it’s } else {). Please align the formatting to match the surrounding conventions.

Suggested change
if (!$trailingSlash){
$baseUrl = rtrim(Configuration::Instance()->GetKey(ConfigKeys::AUTHENTICATION_OAUTH2_URL_AUTHORIZE), '/');
}
else {
if (!$trailingSlash) {
$baseUrl = rtrim(Configuration::Instance()->GetKey(ConfigKeys::AUTHENTICATION_OAUTH2_URL_AUTHORIZE), '/');
} else {

Copilot uses AI. Check for mistakes.
$baseUrl = Configuration::Instance()->GetKey(ConfigKeys::AUTHENTICATION_OAUTH2_URL_AUTHORIZE);
}
$clientId = Configuration::Instance()->GetKey(ConfigKeys::AUTHENTICATION_OAUTH2_CLIENT_ID);
$redirectUri = $this->buildRedirectUri(Configuration::Instance()->GetKey(ConfigKeys::AUTHENTICATION_OAUTH2_REDIRECT_URI));

Expand Down
1 change: 1 addition & 0 deletions config/config.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -705,6 +705,7 @@
'oauth2.name' => 'OAuth2',

# OAuth2 endpoint URLs and client credentials
'oauth2.trailing.slash' => false,
'oauth2.url.authorize' => '',
'oauth2.url.token' => '',
'oauth2.url.userinfo' => '',
Expand Down
8 changes: 8 additions & 0 deletions lib/Config/ConfigKeys.php
Original file line number Diff line number Diff line change
Expand Up @@ -1491,6 +1491,14 @@ class ConfigKeys
'description' => 'Display name for OAuth2 login',
'section' => 'authentication'
];
public const AUTHENTICATION_OAUTH2_TRAILING_SLASH = [
'key' => 'authentication.oauth2.trailing.slash',
'type' => 'boolean',
'default' => false,
'label' => 'Enable Trailing Slash',
'description' => 'Enable Trailing Slash for OAuth2 URL',
'section' => 'authentication'
];
public const AUTHENTICATION_OAUTH2_URL_AUTHORIZE = [
'key' => 'authentication.oauth2.url.authorize',
'type' => 'string',
Expand Down
Loading