From: Dessalines Date: Mon, 5 Oct 2020 00:10:15 +0000 (-0500) Subject: Password length check. Fixes #1087 X-Git-Url: http://these/git/%22https:/nerdica.net/%7B%24%7B%60data:application/static/%24%7B%60data:application/%7BallRss%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());