From 87e0f9c6a282c903104aa1d0b69e2ea953c03d7d Mon Sep 17 00:00:00 2001 From: harsh mahajan Date: Tue, 15 Sep 2026 13:12:03 +0530 Subject: [PATCH] fix(console): allow redirects to the console host when _APP_CONSOLE_URL is set The default OAuth2 success and failure URLs are built on the console URL, and the callback validates them against the allowed hostnames. A console served on its own host was missing from that list, so the default redirects were rejected. --- app/init/resources/request.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/init/resources/request.php b/app/init/resources/request.php index 7f4d949e77..3453c7e5a6 100644 --- a/app/init/resources/request.php +++ b/app/init/resources/request.php @@ -251,6 +251,12 @@ return function (Container $context): void { $context->set('allowedHostnames', function (array $platform, Document $project, Document $rule, Document $devKey, Request $request) { $allowed = [...($platform['hostnames'] ?? [])]; + /* Add the console host, the default OAuth2 redirects land on it even when _APP_CONSOLE_URL points elsewhere */ + $consoleHostname = \parse_url($platform['consoleUrl'] ?? '', PHP_URL_HOST); + if (! empty($consoleHostname)) { + $allowed[] = $consoleHostname; + } + /* Add platform configured hostnames */ if (! $project->isEmpty() && $project->getId() !== 'console') { $platforms = $project->getAttribute('platforms', []);