{"record":{"id":"68eab410085bbbe6","repo":"zed-industries/zed","slug":"missing-code-parameter-in-oauth-callback","errorCode":null,"errorMessage":"missing 'code' parameter in OAuth callback","messagePattern":"missing 'code' parameter in OAuth callback","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/oauth_callback_server/src/oauth_callback_server.rs","lineNumber":213,"sourceCode":"                    }\n                    \"error_description\" => {\n                        if !value.is_empty() {\n                            error_description = Some(value.into_owned());\n                        }\n                    }\n                    _ => {}\n                }\n            }\n\n            if let Some(error_code) = error {\n                anyhow::bail!(\n                    \"OAuth authorization failed: {} ({})\",\n                    error_code,\n                    error_description.as_deref().unwrap_or(\"no description\")\n                );\n            }\n\n            let code = code.ok_or_else(|| anyhow!(\"missing 'code' parameter in OAuth callback\"))?;\n            let state =\n                state.ok_or_else(|| anyhow!(\"missing 'state' parameter in OAuth callback\"))?;\n\n            Ok(Self { code, state })\n        }\n    }\n\n    /// How long to wait for the browser to complete the OAuth flow before giving\n    /// up and releasing the loopback port.\n    const OAUTH_CALLBACK_TIMEOUT: Duration = Duration::from_secs(2 * 60);\n\n    /// Start a loopback HTTP server to receive the OAuth authorization callback.\n    ///\n    /// Binds to an ephemeral loopback port. Returns `(redirect_uri, callback_future)`.\n    /// The caller should use the redirect URI in the authorization request, open\n    /// the browser, then await the future to receive the callback.\n    pub fn start_oauth_callback_server() -> Result<(\n        String,","sourceCodeStart":195,"sourceCodeEnd":231,"githubUrl":"https://github.com/zed-industries/zed/blob/f4178619acd0d47ea1f76a2025c42962c6d6638c/crates/oauth_callback_server/src/oauth_callback_server.rs#L195-L231","documentation":"Parse guard in OAuthCallbackParams::parse_query: the provider's redirect to the callback URL contained no `code` query parameter (and no error parameters either), so an authorization code cannot be extracted and sign-in cannot complete.","triggerScenarios":"Thrown at crates/oauth_callback_server/src/oauth_callback_server.rs:213 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Retry the OAuth sign-in flow from the beginning","Check the provider's redirect configuration includes the authorization code response type"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"f4178619acd0d47ea1f76a2025c42962c6d6638c","analyzedAt":"2026-08-20T19:29:52.058Z","contentChangedAt":"2026-08-20T19:29:52.058Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}