From 557d476001cd1e918ef27697cf9f800d05fcb208 Mon Sep 17 00:00:00 2001 From: Dessalines Date: Sun, 4 Oct 2020 19:10:15 -0500 Subject: [PATCH] Password length check. Fixes #1087 --- lemmy_api/src/user.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lemmy_api/src/user.rs b/lemmy_api/src/user.rs index 4324c9368..17bb12093 100644 --- a/lemmy_api/src/user.rs +++ b/lemmy_api/src/user.rs @@ -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());