aboutsummaryrefslogtreecommitdiff
path: root/azalea-auth
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
parentbdd2fc91e11e2896d8e1c7046df247e1075bd40d (diff)
downloadazalea-drasl-34f53baf85fb5c7163ec5d71a8ab9d45d3f271b6.tar.xz
update to rust edition 2024
Diffstat (limited to 'azalea-auth')
-rwxr-xr-xazalea-auth/src/auth.rs6
-rw-r--r--azalea-auth/src/certs.rs2
-rwxr-xr-xazalea-auth/src/sessionserver.rs2
3 files changed, 5 insertions, 5 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);
diff --git a/azalea-auth/src/certs.rs b/azalea-auth/src/certs.rs
index 9f9147a8..7a6e12f9 100644
--- a/azalea-auth/src/certs.rs
+++ b/azalea-auth/src/certs.rs
@@ -1,6 +1,6 @@
use base64::Engine;
use chrono::{DateTime, Utc};
-use rsa::{pkcs8::DecodePrivateKey, RsaPrivateKey};
+use rsa::{RsaPrivateKey, pkcs8::DecodePrivateKey};
use serde::Deserialize;
use thiserror::Error;
use tracing::trace;
diff --git a/azalea-auth/src/sessionserver.rs b/azalea-auth/src/sessionserver.rs
index e7052e11..87d0e32c 100755
--- a/azalea-auth/src/sessionserver.rs
+++ b/azalea-auth/src/sessionserver.rs
@@ -159,7 +159,7 @@ pub async fn serverside_auth(
StatusCode::FORBIDDEN => {
return Err(ServerSessionServerError::Unknown(
res.json::<ForbiddenError>().await?.error,
- ))
+ ));
}
status_code => {
// log the headers