You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
IdempotentSessionWizardView.render_done - line 208/9
Code that used to be in last revision was:
if not (form_key in self.idempotent_dict or form_obj.is_valid()):
Now there's:
if getattr(form_obj, 'idempotent', True) and not form_obj.is_valid():
I suspect the result of that is a second call to form_obj.is_valid() triggers a second check in django_otp/models.py - line 253 - in verify_token() which returns false the second time because it already validated once and the internally kept token was deleted. see: src/django_otp/models.py:251
Possible Solution
The check for idempotent here should be with False default value, then it makes sense not to trigger again the form.is_valid() - as follows:
if getattr(form_obj, 'idempotent', False) and not form_obj.is_valid():
Note that I am using latest master branch of django_two_factor_auth, as I need some recent fixes.
Steps to Reproduce (for bugs)
Guess with latest version trying to setup email method...
Your Environment
Browser and version:
Python version: 3.7.10
Django version: 3.2.16
django-otp version: 1.1.4
django-two-factor-auth version: master/latest from github
Link to your project:
The text was updated successfully, but these errors were encountered:
IdempotentSessionWizardView.render_done - line 208/9
Code that used to be in last revision was:
if not (form_key in self.idempotent_dict or form_obj.is_valid()):
Now there's:
if getattr(form_obj, 'idempotent', True) and not form_obj.is_valid():
I suspect the result of that is a second call to form_obj.is_valid() triggers a second check in django_otp/models.py - line 253 - in verify_token() which returns false the second time because it already validated once and the internally kept token was deleted. see: src/django_otp/models.py:251
Possible Solution
The check for idempotent here should be with False default value, then it makes sense not to trigger again the form.is_valid() - as follows:
if getattr(form_obj, 'idempotent', False) and not form_obj.is_valid():
Note that I am using latest master branch of django_two_factor_auth, as I need some recent fixes.
Steps to Reproduce (for bugs)
Guess with latest version trying to setup email method...
Your Environment
The text was updated successfully, but these errors were encountered: