From 1033995801f4a274dba9c9e041da82cfd52e38f9 Mon Sep 17 00:00:00 2001 From: Dessalines Date: Sat, 18 Sep 2021 19:43:08 -0400 Subject: [PATCH] Set a 10 char minimum password length. --- crates/api_common/src/lib.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crates/api_common/src/lib.rs b/crates/api_common/src/lib.rs index a79e842ee..1e57ffa70 100644 --- a/crates/api_common/src/lib.rs +++ b/crates/api_common/src/lib.rs @@ -426,7 +426,8 @@ pub async fn build_federated_instances( /// Checks the password length pub fn password_length_check(pass: &str) -> Result<(), LemmyError> { - if pass.len() > 60 { + let password_length = pass.len(); + if !(10..=60).contains(&password_length) { Err(ApiError::err("invalid_password").into()) } else { Ok(())