mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-16 20:49:00 -04:00
Fix the user flow when the user account is locked.
The user has 10 tries at the password, after which the account is locked. The same is true for the verify code, the user will have 10 tries before the user account is locked.
This commit is contained in:
@@ -75,6 +75,11 @@ class UserApiClient(NotifyAdminAPIClient):
|
||||
user_data = self.post(url, data=data)
|
||||
return User(user_data['data'], max_failed_login_count=self.max_failed_login_count)
|
||||
|
||||
def reset_failed_login_count(self, user_id):
|
||||
url = "/user/{}/reset-failed-login-count".format(user_id)
|
||||
user_data = self.post(url, data={})
|
||||
return User(user_data['data'], max_failed_login_count=self.max_failed_login_count)
|
||||
|
||||
def update_password(self, user_id, password):
|
||||
data = {"_password": password}
|
||||
url = "/user/{}/update-password".format(user_id)
|
||||
@@ -152,7 +157,6 @@ class UserApiClient(NotifyAdminAPIClient):
|
||||
def activate_user(self, user):
|
||||
if user.state == 'pending':
|
||||
user.state = 'active'
|
||||
user._failed_login_count = 0
|
||||
return self.update_user(user)
|
||||
else:
|
||||
return user
|
||||
|
||||
Reference in New Issue
Block a user