Skip to content

fix: use WSL2 host IP for OAuth callback instead of 127.0.0.1#1

Open
Jadoothespitz (Jadoothespitz) wants to merge 1 commit intogetcompanion-ai:mainfrom
Jadoothespitz:main
Open

fix: use WSL2 host IP for OAuth callback instead of 127.0.0.1#1
Jadoothespitz (Jadoothespitz) wants to merge 1 commit intogetcompanion-ai:mainfrom
Jadoothespitz:main

Conversation

@Jadoothespitz
Copy link
Copy Markdown

@Jadoothespitz Jadoothespitz (Jadoothespitz) commented Apr 8, 2026

Problem

On WSL2, the OAuth callback server binds to 127.0.0.1, but WSL2's 127.0.0.1 is not reachable from the Windows browser due to WSL2's isolated network. The login flow fails because the browser cannot connect to the callback URL.

Fix

Detect WSL2 environment by checking /proc/version for "microsoft", then use the actual WSL2 network IP (via hostname -I) as the listen host and redirect URI, which is accessible from the Windows browser.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant