If new sms requested, then check and send redirected to two factor

in all cases but should have redirected to verify for pending users.
This commit is contained in:
Adam Shimali
2016-03-21 12:32:07 +00:00
parent 18633af83c
commit c2c98248a1
4 changed files with 29 additions and 6 deletions

View File

@@ -41,4 +41,7 @@ def check_and_resend_verification_code():
# TODO there needs to be a way to generate a new session id
user = user_api_client.get_user_by_email(session['user_details']['email'])
user_api_client.send_verify_code(user.id, 'sms', user.mobile_number)
return redirect(url_for('main.two_factor'))
if user.state == 'pending':
return redirect(url_for('main.verify'))
else:
return redirect(url_for('main.two_factor'))