fix(auth): Fix problem of BadSignature in django two factor auth library #19351
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
The hashing involved in the remember 2FA cookie might change when we upgrade Django (or due to other reasons). When the user has such a cookie to remember 2FA, meaning they would log in and expect to skip 2FA, they will get instead an error message and no way to continue. The solution for the user would be to delete the cookie.
What ideally should happen: The user continues and skips 2FA since the cookie is valid.
What at least can happen: The user can continue and enters 2FA. This is what the PR provides.
Fixes #19350
Fixes POSTHOG-DJW
Caused by jazzband/django-two-factor-auth#686
Changes
How did you test this code?