{"record":{"id":"59af83a2f545253f","repo":"zeroclaw-labs/zeroclaw","slug":"email-oauth2-device-code-flow-timed-out-before-aut","errorCode":null,"errorMessage":"Email OAuth2 device-code flow timed out before authorization","messagePattern":"Email OAuth2 device-code flow timed out before authorization","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/zeroclaw-providers/src/auth/email_oauth2.rs","lineNumber":130,"sourceCode":"        expires_in: parsed.expires_in,\n        interval: parsed.interval.unwrap_or(5).max(1),\n        message: parsed.message,\n    })\n}\n\n/// Poll the token endpoint until the user completes authorization or the flow expires.\npub async fn poll_device_code_tokens(\n    client: &Client,\n    token_url: &str,\n    client_id: &str,\n    device: &DeviceCodeStart,\n) -> Result<TokenSet> {\n    let started = Instant::now();\n    let mut interval_secs = device.interval.max(1);\n\n    loop {\n        if started.elapsed() > Duration::from_secs(device.expires_in) {\n            anyhow::bail!(\"Email OAuth2 device-code flow timed out before authorization\");\n        }\n\n        tokio::time::sleep(Duration::from_secs(interval_secs)).await;\n\n        let form: &[(&str, &str)] = &[\n            (\"grant_type\", \"urn:ietf:params:oauth:grant-type:device_code\"),\n            (\"device_code\", device.device_code.as_str()),\n            (\"client_id\", client_id),\n        ];\n\n        let response = client\n            .post(token_url)\n            .form(form)\n            .send()\n            .await\n            .context(\"Failed polling email OAuth2 token endpoint\")?;\n\n        if response.status().is_success() {","sourceCodeStart":112,"sourceCodeEnd":148,"githubUrl":"https://github.com/zeroclaw-labs/zeroclaw/blob/88bb9c8533fc57ed7a03e36ca7c9ed2bf8336dcc/crates/zeroclaw-providers/src/auth/email_oauth2.rs#L112-L148","documentation":"Error \"Email OAuth2 device-code flow timed out before authorization\" thrown in zeroclaw-labs/zeroclaw.","triggerScenarios":"Thrown at crates/zeroclaw-providers/src/auth/email_oauth2.rs:130 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Complete the device-code authorization promptly; restart the flow if it timed out."],"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"}