aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLizzy Fleckenstein <lizzy@vlhl.dev>2026-05-10 16:44:04 +0200
committerLizzy Fleckenstein <lizzy@vlhl.dev>2026-05-10 16:44:04 +0200
commit98f9f7cd2eaf64c18cca354c2062227a4abf6df0 (patch)
tree44ed29604bb23131a1b166c4985b58db80389958
parenta5737abdf50f219faa5667bf9cd393bb59b55a3e (diff)
downloadazalea-drasl-98f9f7cd2eaf64c18cca354c2062227a4abf6df0.tar.xz
add certs_backend to AccountTrait
-rw-r--r--azalea-client/src/account/microsoft.rs3
-rw-r--r--azalea-client/src/account/mod.rs4
-rw-r--r--azalea-client/src/plugins/chat_signing.rs5
3 files changed, 10 insertions, 2 deletions
diff --git a/azalea-client/src/account/microsoft.rs b/azalea-client/src/account/microsoft.rs
index 37ca6f05..8a7b075d 100644
--- a/azalea-client/src/account/microsoft.rs
+++ b/azalea-client/src/account/microsoft.rs
@@ -215,6 +215,9 @@ impl AccountTrait for MicrosoftWithAccessTokenAccount {
fn set_certs(&self, certs: azalea_auth::certs::Certificates) {
*self.certs.lock() = Some(certs);
}
+ fn certs_backend(&self) -> Option<&str> {
+ Some("https://api.minecraftservices.com/player")
+ }
fn refresh(&self) -> BoxFuture<'_, Result<(), azalea_auth::AuthError>> {
Box::pin(async {
let msa_value = self.msa.lock().clone();
diff --git a/azalea-client/src/account/mod.rs b/azalea-client/src/account/mod.rs
index a6615ad7..23ca7976 100644
--- a/azalea-client/src/account/mod.rs
+++ b/azalea-client/src/account/mod.rs
@@ -104,6 +104,10 @@ pub trait AccountTrait: Send + Sync + Debug {
let _ = certs;
}
+ fn certs_backend(&self) -> Option<&str> {
+ None
+ }
+
/// Typically used to tell Mojang's sessionserver that we are going to join
/// a server.
///
diff --git a/azalea-client/src/plugins/chat_signing.rs b/azalea-client/src/plugins/chat_signing.rs
index a0404636..10563d7f 100644
--- a/azalea-client/src/plugins/chat_signing.rs
+++ b/azalea-client/src/plugins/chat_signing.rs
@@ -123,12 +123,13 @@ pub fn request_certs_if_needed(
true
};
- if should_refresh && let Some(access_token) = account.access_token() {
+ if should_refresh && let Some(access_token) = account.access_token() && let Some(backend) = account.certs_backend() {
let task_pool = IoTaskPool::get();
+ let backend = backend.to_owned();
debug!("Started task to fetch certs");
let task = task_pool.spawn(async_compat::Compat::new(async move {
- azalea_auth::certs::fetch_certificates(&access_token).await
+ azalea_auth::certs::fetch_certificates_with_backend_url(&access_token, &backend).await
}));
commands
.entity(entity)