mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-23 15:57:23 -04:00
Do not verify sms for pending users with email auth
This is to fix a bug where a user creates an account but doesn't complete registration, then they are invited to a service that changes their auth to email_auth, and then when they try to complete registration they are still asked for sms code. It should save users some pain, and reduce number of support tickets.
This commit is contained in:
committed by
Leo Hemsted
parent
262e2ba6e7
commit
8112930e24
@@ -63,6 +63,13 @@ def verify_email(token):
|
||||
return redirect(url_for('main.sign_in'))
|
||||
|
||||
session['user_details'] = {"email": user.email_address, "id": user.id}
|
||||
|
||||
if user.auth_type == 'email_auth':
|
||||
try:
|
||||
return activate_user(user.id)
|
||||
finally:
|
||||
session.pop('user_details', None)
|
||||
|
||||
user.send_verify_code()
|
||||
return redirect(url_for('main.verify'))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user