jazzband / django-two-factor-auth

Complete Two-Factor Authentication for Django providing the easiest integration into most Django projects.
MIT License
1.71k stars 448 forks source link

Only validate token against chosen device 2 (#473) #683

Closed PetrDlouhy closed 10 months ago

PetrDlouhy commented 11 months ago

This is rebase of #521 to the current master branch.

Please follow the description at #521

PetrDlouhy commented 11 months ago

The tests are not passing because of #684

codecov[bot] commented 11 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (9159d1c) 95.52% compared to head (b805807) 95.57%. Report is 4 commits behind head on master.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #683 +/- ## ========================================== + Coverage 95.52% 95.57% +0.04% ========================================== Files 78 78 Lines 3354 3389 +35 Branches 377 377 ========================================== + Hits 3204 3239 +35 Misses 119 119 Partials 31 31 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

PetrDlouhy commented 10 months ago

@claudep Thank you for your comments. I had to investigate this much deeper and I found that the issue #473 might be already resolved by https://github.com/jazzband/django-two-factor-auth/commit/8deb380eb3cbb9b27f90a8e822e4951c31856515

The test from the original PR is passing in current master and I added one more test to ensure that the throttling will work correctly in the future.

Would you be OK with merging just those tests?

claudep commented 10 months ago

Absolutely, and thanks a ton for these investigations :heart_eyes: