mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-03 18:01:08 -05:00
restore email sign in code expiry functionality
reverts 789112a31f
however, keeps the changes to the tests as they were an improvement
This commit is contained in:
@@ -190,8 +190,7 @@ def verify_user_code(user_id):
|
||||
# only relevant from sms
|
||||
increment_failed_login_count(user_to_verify)
|
||||
raise InvalidRequest("Code not found", status_code=404)
|
||||
# TODO: Fix email flow so that clicking link doesn't expire emails
|
||||
if datetime.utcnow() > code.expiry_datetime or (code.code_used and data['code_type'] != 'email'):
|
||||
if datetime.utcnow() > code.expiry_datetime or code.code_used:
|
||||
# sms and email
|
||||
increment_failed_login_count(user_to_verify)
|
||||
raise InvalidRequest("Code has expired", status_code=400)
|
||||
|
||||
Reference in New Issue
Block a user