Validate email access based on code_type anot auth_type

when verifying the code is correct. This way if user has sms_auth
and we send them verification code to validate their email access,
and they click the link in the email, their access will be validated
correctly.
This commit is contained in:
Pea Tyczynska
2020-01-31 17:19:24 +00:00
parent 0f6e8c330d
commit 0132d76c16
2 changed files with 9 additions and 3 deletions

View File

@@ -197,7 +197,7 @@ def verify_user_code(user_id):
user_to_verify.current_session_id = str(uuid.uuid4())
user_to_verify.logged_in_at = datetime.utcnow()
if user_to_verify.auth_type == 'email_auth':
if data['code_type'] == 'email':
user_to_verify.email_access_validated_at = datetime.utcnow()
user_to_verify.failed_login_count = 0
save_model_user(user_to_verify)