Skip to content

Commit f1ea58e

Browse files
authored
fix: use an async http client (#44)
- changes the oauth fetcher to use an async http client to play nice with tokio during tests
1 parent 6d53728 commit f1ea58e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/tasks/oauth.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use std::sync::Arc;
55
use crate::config::BuilderConfig;
66
use oauth2::{
77
basic::{BasicClient, BasicTokenType},
8-
reqwest::http_client,
8+
reqwest::async_http_client,
99
AuthUrl, ClientId, ClientSecret, EmptyExtraTokenFields, StandardTokenResponse, TokenUrl,
1010
};
1111
use tokio::{sync::RwLock, task::JoinHandle};
@@ -89,7 +89,8 @@ impl Authenticator {
8989
Some(TokenUrl::new(config.oauth_token_url.clone())?),
9090
);
9191

92-
let token_result = client.exchange_client_credentials().request(http_client)?;
92+
let token_result =
93+
client.exchange_client_credentials().request_async(async_http_client).await?;
9394

9495
Ok(token_result)
9596
}

0 commit comments

Comments
 (0)