From: Dessalines Date: Sat, 18 Sep 2021 23:43:08 +0000 (-0400) Subject: Set a 10 char minimum password length. X-Git-Url: http://these/git/%7B%60%24%7BwebArchiveUrl%7D/%22%7B%7D/%22https:/nerdica.net/%7B?a=commitdiff_plain;h=1033995801f4a274dba9c9e041da82cfd52e38f9;p=lemmy.git Set a 10 char minimum password length. --- diff --git a/crates/api_common/src/lib.rs b/crates/api_common/src/lib.rs index a79e842e..1e57ffa7 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(())