mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-16 20:49:00 -04:00
109898688: All codes are valid until one code is used, then they are all marked used.
Fixed the is_active() method on the Users model, if the user was pending they would come back as active, allowing a user to sign in before being active. There is still a problem with the validate_sms_code and validate_email_code method.
This commit is contained in:
@@ -19,7 +19,6 @@ def check_and_resend_email_code():
|
||||
if form.validate_on_submit():
|
||||
user = users_dao.get_user_by_id(session['user_id'])
|
||||
users_dao.update_email_address(id=user.id, email_address=form.email_address.data)
|
||||
verify_codes_dao.use_code_for_user_and_type(user_id=user.id, code_type='email')
|
||||
send_email_code(user_id=user.id, email=user.email_address)
|
||||
return redirect('/verify')
|
||||
return jsonify(form.errors), 400
|
||||
@@ -37,7 +36,6 @@ def check_and_resend_text_code():
|
||||
if form.validate_on_submit():
|
||||
user = users_dao.get_user_by_id(session['user_id'])
|
||||
users_dao.update_mobile_number(id=user.id, mobile_number=form.mobile_number.data)
|
||||
verify_codes_dao.use_code_for_user_and_type(user_id=user.id, code_type='sms')
|
||||
send_sms_code(user_id=user.id, mobile_number=user.mobile_number)
|
||||
return redirect('/verify')
|
||||
return jsonify(form.errors), 400
|
||||
|
||||
Reference in New Issue
Block a user