diff --git a/src/auth/oauth/m2m.rs b/src/auth/oauth/m2m.rs index 1ba757f5..74e93ec8 100644 --- a/src/auth/oauth/m2m.rs +++ b/src/auth/oauth/m2m.rs @@ -287,7 +287,7 @@ impl AuthProvider for ClientCredentialsProvider { .request_async(http_client.inner()) .await .map_err(|e| { - Error::io() + Error::unauthenticated() .message(format!("M2M token exchange failed: {}", e)) .context("client credentials grant") })?; diff --git a/src/auth/oauth/u2m.rs b/src/auth/oauth/u2m.rs index f1c5d7e0..2d2e8b08 100644 --- a/src/auth/oauth/u2m.rs +++ b/src/auth/oauth/u2m.rs @@ -447,7 +447,7 @@ impl AuthProvider for AuthorizationCodeProvider { .request_async(http_client.inner()) .await .map_err(|e| { - Error::io() + Error::unauthenticated() .message(format!("U2M authorization code exchange failed: {}", e)) .context("authorization code grant") })?;