]> Untitled Git - lemmy.git/commitdiff
Set a 10 char minimum password length.
authorDessalines <tyhou13@gmx.com>
Sat, 18 Sep 2021 23:43:08 +0000 (19:43 -0400)
committerDessalines <tyhou13@gmx.com>
Sat, 18 Sep 2021 23:43:08 +0000 (19:43 -0400)
crates/api_common/src/lib.rs

index a79e842eea71763ae3c7d2388ccaa03c63910330..1e57ffa70386043cec487340d5ba2122c658a95b 100644 (file)
@@ -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(())