diff --git a/apps/web/src-tauri/src/lib.rs b/apps/web/src-tauri/src/lib.rs index 98b15034e..920fbbf5e 100644 --- a/apps/web/src-tauri/src/lib.rs +++ b/apps/web/src-tauri/src/lib.rs @@ -19,7 +19,7 @@ fn active_nonces() -> &'static Mutex> { /// Find an available port in the range fn find_available_port() -> Option { for port in OAUTH_PORT_MIN..=OAUTH_PORT_MAX { - if TcpListener::bind(format!("127.0.0.1:{}", port)).is_ok() { + if TcpListener::bind(format!("localhost:{}", port)).is_ok() { return Some(port); } } @@ -81,7 +81,7 @@ fn start_oauth_server(app: AppHandle) -> Result<(u16, String), String> { } // Bind to the port - let listener = TcpListener::bind(format!("127.0.0.1:{}", port)) + let listener = TcpListener::bind(format!("localhost:{}", port)) .map_err(|e| format!("Failed to bind port {}: {}", port, e))?; listener @@ -133,7 +133,7 @@ fn start_oauth_server(app: AppHandle) -> Result<(u16, String), String> { // Build callback URL for frontend let callback_url = format!( - "http://127.0.0.1:{}?code={}&state={}", + "http://localhost:{}?code={}&state={}", server_port, urlencoding::encode(code), urlencoding::encode(state) diff --git a/apps/web/src/routes/auth/desktop-callback.tsx b/apps/web/src/routes/auth/desktop-callback.tsx index 8db9224c8..c16e7c92b 100644 --- a/apps/web/src/routes/auth/desktop-callback.tsx +++ b/apps/web/src/routes/auth/desktop-callback.tsx @@ -102,7 +102,7 @@ function DesktopCallbackPage() { for (let i = 0; i < maxRetries; i++) { try { - const response = await fetch(`http://127.0.0.1:${port}`, { + const response = await fetch(`http://localhost:${port}`, { method: "POST", headers: { "Content-Type": "application/json",