aboutsummaryrefslogtreecommitdiff
path: root/azalea-auth/src/auth.rs
diff options
context:
space:
mode:
authormat <git@matdoes.dev>2025-02-22 23:01:54 +0000
committermat <git@matdoes.dev>2025-02-22 23:01:54 +0000
commit34f53baf85fb5c7163ec5d71a8ab9d45d3f271b6 (patch)
tree7920fec1203e8e96463a142f5f6da6164e76e684 /azalea-auth/src/auth.rs
parentbdd2fc91e11e2896d8e1c7046df247e1075bd40d (diff)
downloadazalea-drasl-34f53baf85fb5c7163ec5d71a8ab9d45d3f271b6.tar.xz
update to rust edition 2024
Diffstat (limited to 'azalea-auth/src/auth.rs')
-rwxr-xr-xazalea-auth/src/auth.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/azalea-auth/src/auth.rs b/azalea-auth/src/auth.rs
index 55d7d36a..99dfc115 100755
--- a/azalea-auth/src/auth.rs
+++ b/azalea-auth/src/auth.rs
@@ -360,7 +360,7 @@ pub async fn get_ms_auth_token(
tokio::time::sleep(std::time::Duration::from_secs(res.interval)).await;
trace!("Polling to check if user has logged in...");
- if let Ok(access_token_response) = client
+ let res = client
.post(format!(
"https://login.live.com/oauth20_token.srf?client_id={client_id}"
))
@@ -372,8 +372,8 @@ pub async fn get_ms_auth_token(
.send()
.await?
.json::<AccessTokenResponse>()
- .await
- {
+ .await;
+ if let Ok(access_token_response) = res {
trace!("access_token_response: {:?}", access_token_response);
let expires_at = SystemTime::now()
+ std::time::Duration::from_secs(access_token_response.expires_in);