Closed Gautier closed 10 months ago
Any updates on this? We ran into this issue as well. Would be great to have a fix on the main package. Can I help in any way?
@moggers87 @Gautier What is state of this PR? Could I help somehow?
Rebasing looks like the next step, then @PetrDlouhy, your review would be welcome, too!
@claudep I have rebased this in PR #683, all tests are passing now.
I have tried to rebase this in #683, but I am not able to resolve the review comments there without much deeper investigation.
@Gautier Would you be able to look at it?
I am a bit confused, because I tried to run the tests.test_views_login.LoginTest.test_totp_token_does_not_impact_backup_token
test with the unfixed forms.py
code and it seems to pass.
I will try to give it more time, but it would save me some nerves if you could look at it.
I did investigate it a bit more and I realized that in the new version of django-two-factor-auth
there is AuthenticationTokenForm._chosen_device()
newly implemented.
I am not yet sure if that is enough to fix #473 or there is some case in which it could still fail.
The relevant test from this PR is merged now and is passing because of other fixes in the current branch.
Other changes included in this PR are probably not needed and if they are, they would need a clear test case first. I am closing this, open new PR in such cases.
Description
Changes the AuthenticationTokenForm to only validate a token against the chosen device.
The first version of this PR only includes a failing test to demonstrate the problem and the second version is a suggestion on how to fix it.
Motivation and Context
I received the same error report as #473 for one of my system using django-two-factor-auth and noticed the backup tokens
throttling_failure_count
were being incremented even though the phone TOTP worked.Types of changes
Checklist: