From 8246f07ede4fd616c459ac7a4160e41e8d1cce68 Mon Sep 17 00:00:00 2001 From: Jose Celano Date: Fri, 6 Sep 2024 13:48:15 +0100 Subject: [PATCH] feat: min and max password length should be also valid In the condiguration uyou can set the min and max password length but those values are not include (not valid). ```toml [auth.password_constraints] max_password_length = 64 min_password_length = 6 ``` This commit allows password with 6 and 64 chars. --- src/services/user.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/services/user.rs b/src/services/user.rs index 5e837dd3..fd9ab995 100644 --- a/src/services/user.rs +++ b/src/services/user.rs @@ -461,11 +461,11 @@ fn validate_password_constraints( let password_length = password.len(); - if password_length <= password_rules.min_password_length { + if password_length < password_rules.min_password_length { return Err(ServiceError::PasswordTooShort); } - if password_length >= password_rules.max_password_length { + if password_length > password_rules.max_password_length { return Err(ServiceError::PasswordTooLong); }