From 1abe8f7835dd963fa217034aefad7b81d41313b4 Mon Sep 17 00:00:00 2001 From: nexy7574 Date: Sat, 12 Jul 2025 22:37:49 +0100 Subject: [PATCH] fix: Creation bug --- src/api/client/account.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/api/client/account.rs b/src/api/client/account.rs index 11414abf..0cea7bd9 100644 --- a/src/api/client/account.rs +++ b/src/api/client/account.rs @@ -298,7 +298,9 @@ pub(crate) async fn register_route( session: None, auth_error: None, }; - let mut skip_auth = body.appservice_info.is_some(); + let skip_auth = body.appservice_info.is_some() || is_guest; + + // Populate required UIAA flows if services.globals.registration_token.is_some() { // Registration token required uiaainfo.flows.push(AuthFlow { @@ -317,9 +319,10 @@ pub(crate) async fn register_route( }, })) .expect("Failed to serialize recaptcha params"); - skip_auth = skip_auth || is_guest; } - } else { + } + + if uiaainfo.flows.is_empty() && !skip_auth { // No registration token necessary, but clients must still go through the flow uiaainfo = UiaaInfo { flows: vec![AuthFlow { stages: vec![AuthType::Dummy] }], @@ -328,7 +331,6 @@ pub(crate) async fn register_route( session: None, auth_error: None, }; - skip_auth = skip_auth || is_guest; } if !skip_auth {