Skip to content

Commit

Permalink
start at 1, better error message
Browse files Browse the repository at this point in the history
  • Loading branch information
dolevf committed Sep 30, 2020
1 parent d488fb6 commit d8b1d3c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion core/redis.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ def is_ip_blocked(self, ip):
if int(attempts) >= config.MAX_LOGIN_ATTEMPTS:
return True
else:
self.r.set(key, 0, ex=300)
self.r.set(key, 1, ex=300)
return False

def log_attempt(self, ip):
Expand Down
3 changes: 2 additions & 1 deletion views/view_login.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ def view_login():
session['session'] = username
return redirect('/')
else:
return render_template('login.html', err='Incorrect username or password.')
return render_template('login.html', err='Incorrect username or password. \
After 5 attempts, you will get blocked.')

if not utils.is_version_latest():
msg = 'New Version is Available'
Expand Down

0 comments on commit d8b1d3c

Please sign in to comment.