{"record":{"id":"0fce484cdf9fceca","repo":"zed-industries/zed","slug":"didn-t-receive-login-redirect","errorCode":null,"errorMessage":"didn't receive login redirect","messagePattern":"didn't receive login redirect","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/client/src/client.rs","lineNumber":1541,"sourceCode":"                                        http.build_url(\"/native_app_signin_succeeded\");\n                                    req.respond(\n                                        tiny_http::Response::empty(302).with_header(\n                                            tiny_http::Header::from_bytes(\n                                                &b\"Location\"[..],\n                                                post_auth_url.as_bytes(),\n                                            )\n                                            .unwrap(),\n                                        ),\n                                    )\n                                    .context(\"failed to respond to login http request\")?;\n                                    return Ok((\n                                        callback_params.user_id,\n                                        callback_params.access_token,\n                                    ));\n                                }\n                            }\n\n                            anyhow::bail!(\"didn't receive login redirect\");\n                        })\n                        .await?;\n\n                    let access_token = private_key\n                        .decrypt_string(&access_token)\n                        .context(\"failed to decrypt access token\")?;\n\n                    Ok(Credentials {\n                        user_id: user_id.parse()?,\n                        access_token,\n                    })\n                })\n                .await?;\n\n            cx.update(|cx| cx.activate(true));\n            Ok(credentials)\n        })\n    }","sourceCodeStart":1523,"sourceCodeEnd":1559,"githubUrl":"https://github.com/zed-industries/zed/blob/f4178619acd0d47ea1f76a2025c42962c6d6638c/crates/client/src/client.rs#L1523-L1559","documentation":"During browser sign-in, Zed starts a local HTTP server on 127.0.0.1, opens the Zed sign-in page with the port and a public key, and waits for the browser to redirect back with `user_id` and an encrypted `access_token`. The loop polls `server.recv_timeout(1s)` exactly 100 times (~100 seconds); if no redirect request ever arrives, it gives up with this error.","triggerScenarios":"The sign-in page never redirects to `http://127.0.0.1:<port>/...`: browser failed to open (headless/SSH session without a browser), the user closed the tab before completing sign-in, browser/extension blocked the localhost redirect, OS firewall blocked loopback listening, or clock/token expiry on the server side aborted the flow.","commonSituations":"Signing in over remote desktop/SSH/X-forwarding where `open_url` can't reach a browser; corporate proxies or privacy extensions stripping redirects to localhost; slow sign-in (MFA prompts) exceeding ~100s; firewall rules blocking binding or connecting on 127.0.0.1.","solutions":["Retry the sign-in and complete it promptly in the browser tab that opens — 100 seconds is the budget.","If no browser opened, copy the sign-in URL manually into a browser on the same machine.","Temporarily disable extensions/proxy rules that block or rewrite localhost redirects, and allow loopback connections in firewall settings.","On headless machines, sign in elsewhere and configure credentials via the supported environment/sign-in alternative instead of the browser flow."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"match client.sign_in_with_browser(cx).await {\n    Err(err) if err.to_string().contains(\"didn't receive login redirect\") => {\n        // user likely never completed sign-in in time; safe to retry\n        client.sign_in_with_browser(cx).await\n    }\n    result => result,\n}","preventionTips":["Complete the browser sign-in promptly; the local callback server waits ~100 seconds.","Ensure a default browser is available on the same machine (no headless/SSH sessions).","Allow loopback (127.0.0.1) connections in firewall/proxy settings; disable extensions that rewrite localhost redirects."],"tags":["auth","sign-in","oauth","localhost-callback","timeout"],"backgroundTag":"oauth-callback-timeout","analyzedSha":"f4178619acd0d47ea1f76a2025c42962c6d6638c","analyzedAt":"2026-08-20T19:29:52.058Z","contentChangedAt":"2026-08-20T19:29:52.058Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}