Merge pull request #1173 from LemmyNet/password_length_check

Password length check. Fixes #1087
This commit is contained in:
Nutomic 2020-10-05 20:24:07 +00:00 committed by GitHub
commit c6c107cad1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View 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());