mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-09-05 16:28:24 -04:00
Added a reset of failed_login_count when the user is activated.
Update user from the update-password api call (which resets the failed_login_count)
This commit is contained in:
@@ -31,7 +31,7 @@ def two_factor():
|
|||||||
services = service_api_client.get_active_services({'user_id': str(user_id)}).get('data', [])
|
services = service_api_client.get_active_services({'user_id': str(user_id)}).get('data', [])
|
||||||
# Check if coming from new password page
|
# Check if coming from new password page
|
||||||
if 'password' in session['user_details']:
|
if 'password' in session['user_details']:
|
||||||
user_api_client.update_password(user.id, password=session['user_details']['password'])
|
user = user_api_client.update_password(user.id, password=session['user_details']['password'])
|
||||||
if user.is_locked():
|
if user.is_locked():
|
||||||
form.sms_code.errors.append('Code not found')
|
form.sms_code.errors.append('Code not found')
|
||||||
return render_template('views/two-factor.html', form=form)
|
return render_template('views/two-factor.html', form=form)
|
||||||
|
|||||||
@@ -152,6 +152,7 @@ class UserApiClient(NotifyAdminAPIClient):
|
|||||||
def activate_user(self, user):
|
def activate_user(self, user):
|
||||||
if user.state == 'pending':
|
if user.state == 'pending':
|
||||||
user.state = 'active'
|
user.state = 'active'
|
||||||
|
user._failed_login_count = 0
|
||||||
return self.update_user(user)
|
return self.update_user(user)
|
||||||
else:
|
else:
|
||||||
return user
|
return user
|
||||||
|
|||||||
Reference in New Issue
Block a user