From 570a5bdd78aeffe12a1c30e81112496418d8ff74 Mon Sep 17 00:00:00 2001 From: Miguel Sanchez Gonzalez Date: Mon, 16 Mar 2026 11:05:05 +0100 Subject: [PATCH 1/2] fix: allow browser login to work in containerized environments Bind the OAuth callback server to 0.0.0.0 instead of 127.0.0.1 to allow connections from outside the container, while still showing 127.0.0.1 in the user-facing URL for clarity. Co-Authored-By: Claude Opus 4.6 --- legacy/src/Command/Auth/BrowserLoginCommand.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/legacy/src/Command/Auth/BrowserLoginCommand.php b/legacy/src/Command/Auth/BrowserLoginCommand.php index 5c667c062..eb016fa92 100644 --- a/legacy/src/Command/Auth/BrowserLoginCommand.php +++ b/legacy/src/Command/Auth/BrowserLoginCommand.php @@ -124,8 +124,10 @@ protected function execute(InputInterface $input, OutputInterface $output): int } throw $e; } - $localAddress = '127.0.0.1:' . $port; - $localUrl = 'http://' . $localAddress; + // Bind to 0.0.0.0 to allow access from outside the container/localhost + $localAddress = '0.0.0.0:' . $port; + // Use 127.0.0.1 for the URL shown to users + $localUrl = 'http://127.0.0.1:' . $port; // Then create the document root for the local server. This needs to be // outside the CLI itself (since the CLI may be run as a Phar). @@ -183,6 +185,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int } else { $this->stdErr->writeln('Please open the following URL in a browser and log in:'); $this->stdErr->writeln('' . $localUrl . ''); + $this->stdErr->writeln('' . $localAddress . ''); } // Show some help. From 68618ab14775d86c2d9a477d3548985a4d2155be Mon Sep 17 00:00:00 2001 From: Miguel Sanchez Gonzalez Date: Mon, 16 Mar 2026 11:09:40 +0100 Subject: [PATCH 2/2] removes unnecessary log of the local address --- legacy/src/Command/Auth/BrowserLoginCommand.php | 1 - 1 file changed, 1 deletion(-) diff --git a/legacy/src/Command/Auth/BrowserLoginCommand.php b/legacy/src/Command/Auth/BrowserLoginCommand.php index eb016fa92..48b20649b 100644 --- a/legacy/src/Command/Auth/BrowserLoginCommand.php +++ b/legacy/src/Command/Auth/BrowserLoginCommand.php @@ -185,7 +185,6 @@ protected function execute(InputInterface $input, OutputInterface $output): int } else { $this->stdErr->writeln('Please open the following URL in a browser and log in:'); $this->stdErr->writeln('' . $localUrl . ''); - $this->stdErr->writeln('' . $localAddress . ''); } // Show some help.