Update two-factor to use new update password endpoint and refactor tests

This commit is contained in:
Imdad Ahad
2017-02-20 14:55:28 +00:00
parent a7335ddb33
commit 2c51792ae5
2 changed files with 3 additions and 34 deletions

View File

@@ -29,9 +29,7 @@ def two_factor():
services = service_api_client.get_active_services({'user_id': str(user_id)}).get('data', [])
# 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)
user_api_client.update_password(user.id, password=session['user_details']['password'])
if user.is_locked():
form.sms_code.errors.append('Code not found')
return render_template('views/two-factor.html', form=form)