mirror of
https://gitea.invidious.io/iv-org/invidious-copy-2022-04-11.git
synced 2024-08-15 00:43:26 +00:00
Add error messages for invalid password sizes
This commit is contained in:
parent
19632511d5
commit
7e558c5b1d
1 changed files with 11 additions and 0 deletions
|
@ -803,6 +803,17 @@ post "/login" do |env|
|
||||||
next templated "error"
|
next templated "error"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if password.empty?
|
||||||
|
error_message = "Password cannot be empty"
|
||||||
|
next templated "error"
|
||||||
|
end
|
||||||
|
|
||||||
|
# See https://security.stackexchange.com/a/39851
|
||||||
|
if password.size > 55
|
||||||
|
error_message = "Password cannot be longer than 55 characters"
|
||||||
|
next templated "error"
|
||||||
|
end
|
||||||
|
|
||||||
if !challenge_response || !token
|
if !challenge_response || !token
|
||||||
error_message = "CAPTCHA is a required field"
|
error_message = "CAPTCHA is a required field"
|
||||||
next templated "error"
|
next templated "error"
|
||||||
|
|
Loading…
Reference in a new issue