From: Dessalines Date: Mon, 5 Oct 2020 00:10:15 +0000 (-0500) Subject: Password length check. Fixes #1087 X-Git-Url: http://these/git/%7B%60%24%7BwebArchiveUrl%7D/%22%7B%7D/readmes/%7B%7D/%22%7Burl%7D/%7Biframely.url%7D?a=commitdiff_plain;h=557d476001cd1e918ef27697cf9f800d05fcb208;p=lemmy.git Password length check. Fixes #1087 --- diff --git a/lemmy_api/src/user.rs b/lemmy_api/src/user.rs index 4324c936..17bb1209 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());