]> Untitled Git - lemmy.git/commitdiff
Password length check. Fixes #1087
authorDessalines <tyhou13@gmx.com>
Mon, 5 Oct 2020 00:10:15 +0000 (19:10 -0500)
committerDessalines <tyhou13@gmx.com>
Mon, 5 Oct 2020 00:10:15 +0000 (19:10 -0500)
lemmy_api/src/user.rs

index 4324c93689307f9928df5a0da264ddc0b701cbe6..17bb12093396f84b72198e3cb49361a534fe25f8 100644 (file)
@@ -117,6 +117,11 @@ impl Perform for Register {
       }
     }
 
+    // Password length check
+    if data.password.len() > 60 {
+      return Err(APIError::err("invalid_password").into());
+    }
+
     // Make sure passwords match
     if data.password != data.password_verify {
       return Err(APIError::err("passwords_dont_match").into());