From fda8a00a5071b376feaeb4cf49c7daddcaeed8bd Mon Sep 17 00:00:00 2001 From: Quentin Gliech Date: Thu, 15 Oct 2026 17:47:50 +0200 Subject: [PATCH] Send the `password-too-weak` code with the weak password error The frontend already translates that code, so the user no longer sees the untranslated server message. --- crates/handlers/src/views/register/password.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/crates/handlers/src/views/register/password.rs b/crates/handlers/src/views/register/password.rs index da9a509f1..1475906cd 100644 --- a/crates/handlers/src/views/register/password.rs +++ b/crates/handlers/src/views/register/password.rs @@ -144,11 +144,10 @@ pub(super) async fn register( } if !password_manager.is_password_complex_enough(&form.password)? { - // TODO localise this error state.add_error_on_field( RegisterFormField::Password, FieldError::Policy { - code: None, + code: Some("password-too-weak"), message: "Password is too weak".to_owned(), }, );