zeroclaw-labs/zeroclaw · error

Email OAuth2 authorization was denied

Error message

Email OAuth2 authorization was denied

What it means

Error "Email OAuth2 authorization was denied" thrown in zeroclaw-labs/zeroclaw.

Source

Thrown at crates/zeroclaw-providers/src/auth/email_oauth2.rs:162

            .send()
            .await
            .context("Failed polling email OAuth2 token endpoint")?;

        if response.status().is_success() {
            return parse_token_response(response).await;
        }

        let status = response.status();
        let text = response.text().await.unwrap_or_default();

        if let Ok(err) = serde_json::from_str::<OAuthErrorResponse>(&text) {
            match err.error.as_str() {
                "authorization_pending" => continue,
                "slow_down" => {
                    interval_secs = interval_secs.saturating_add(5);
                    continue;
                }
                "access_denied" => anyhow::bail!("Email OAuth2 authorization was denied"),
                "expired_token" => anyhow::bail!("Email OAuth2 device-code expired"),
                _ => anyhow::bail!(
                    "Email OAuth2 device-code polling failed ({status}): {}",
                    err.error_description.unwrap_or(err.error)
                ),
            }
        }

        anyhow::bail!("Email OAuth2 device-code polling failed ({status}): {text}");
    }
}

async fn parse_token_response(response: reqwest::Response) -> Result<TokenSet> {
    if !response.status().is_success() {
        let status = response.status();
        let body = response.text().await.unwrap_or_default();
        anyhow::bail!("Email OAuth2 token request failed ({status}): {body}");
    }

View on GitHub (pinned to 88bb9c8533)

Solutions

  1. Re-run the OAuth2 flow and approve the authorization request.

When it happens

Trigger: Thrown at crates/zeroclaw-providers/src/auth/email_oauth2.rs:162 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of zeroclaw-labs/zeroclaw@88bb9c8533 (2026-08-23). Data as JSON: /api/errors/53b0115941e1115b. Report an issue: GitHub.