Check if host is denied before verifying password

This commit is contained in:
Leonel Câmara
2016-05-04 19:02:53 +01:00
parent 33c1144e2e
commit 944d8bd8f3
2 changed files with 9 additions and 2 deletions
@@ -121,6 +121,9 @@ def index():
send = URL('site')
if session.authorized:
redirect(send)
elif failed_login_count() >= allowed_number_of_attempts:
time.sleep(2 ** allowed_number_of_attempts)
raise HTTP(403)
elif request.vars.password:
if verify_password(request.vars.password[:1024]):
session.authorized = True