{"record":{"id":"53b0115941e1115b","repo":"zeroclaw-labs/zeroclaw","slug":"email-oauth2-authorization-was-denied","errorCode":null,"errorMessage":"Email OAuth2 authorization was denied","messagePattern":"Email OAuth2 authorization was denied","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/zeroclaw-providers/src/auth/email_oauth2.rs","lineNumber":162,"sourceCode":"            .send()\n            .await\n            .context(\"Failed polling email OAuth2 token endpoint\")?;\n\n        if response.status().is_success() {\n            return parse_token_response(response).await;\n        }\n\n        let status = response.status();\n        let text = response.text().await.unwrap_or_default();\n\n        if let Ok(err) = serde_json::from_str::<OAuthErrorResponse>(&text) {\n            match err.error.as_str() {\n                \"authorization_pending\" => continue,\n                \"slow_down\" => {\n                    interval_secs = interval_secs.saturating_add(5);\n                    continue;\n                }\n                \"access_denied\" => anyhow::bail!(\"Email OAuth2 authorization was denied\"),\n                \"expired_token\" => anyhow::bail!(\"Email OAuth2 device-code expired\"),\n                _ => anyhow::bail!(\n                    \"Email OAuth2 device-code polling failed ({status}): {}\",\n                    err.error_description.unwrap_or(err.error)\n                ),\n            }\n        }\n\n        anyhow::bail!(\"Email OAuth2 device-code polling failed ({status}): {text}\");\n    }\n}\n\nasync fn parse_token_response(response: reqwest::Response) -> Result<TokenSet> {\n    if !response.status().is_success() {\n        let status = response.status();\n        let body = response.text().await.unwrap_or_default();\n        anyhow::bail!(\"Email OAuth2 token request failed ({status}): {body}\");\n    }","sourceCodeStart":144,"sourceCodeEnd":180,"githubUrl":"https://github.com/zeroclaw-labs/zeroclaw/blob/88bb9c8533fc57ed7a03e36ca7c9ed2bf8336dcc/crates/zeroclaw-providers/src/auth/email_oauth2.rs#L144-L180","documentation":"Error \"Email OAuth2 authorization was denied\" thrown in zeroclaw-labs/zeroclaw.","triggerScenarios":"Thrown at crates/zeroclaw-providers/src/auth/email_oauth2.rs:162 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Re-run the OAuth2 flow and approve the authorization request."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"88bb9c8533fc57ed7a03e36ca7c9ed2bf8336dcc","analyzedAt":"2026-08-23T01:07:41.857Z","schemaVersion":2},"datasetVersion":"2026-08-23T08:06:27.607Z"}