mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-25 08:44:23 -04:00
Failed login count set to zero with password reset.
This commit is contained in:
@@ -34,6 +34,7 @@ def two_factor():
|
||||
# Check if coming from new password page
|
||||
if 'password' in session['user_details']:
|
||||
user.set_password(session['user_details']['password'])
|
||||
user.reset_failed_login_count()
|
||||
user_api_client.update_user(user)
|
||||
login_user(user, remember=True)
|
||||
finally:
|
||||
|
||||
@@ -108,6 +108,9 @@ class User(UserMixin):
|
||||
def failed_login_count(self, num):
|
||||
self._failed_login_count += num
|
||||
|
||||
def reset_failed_login_count(self):
|
||||
self._failed_login_count = 0
|
||||
|
||||
def is_locked(self):
|
||||
return self.failed_login_count >= self.max_failed_login_count
|
||||
|
||||
|
||||
Reference in New Issue
Block a user