-
-
Notifications
You must be signed in to change notification settings - Fork 447
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hitting otp_required as a user without device results in infinite login loop #499
Comments
I'm getting this problem even when I have a device set up, regardless of |
This should hopefully be fixed in master with 4bd592c |
@MWeesenaar @claudep I don't have Is this intentional? If so, shouldn't the change be documented? |
I don't think this was intentional, looks like a regression. Thanks for noticing. @MWeesenaar, do you have a plan to avoid this regression? |
@PetrDlouhy , I am sorry that this might introduced regression. So, @claudep , future regression will simply not occur any more, since I have no plans as of now to submit further PRs. |
@PetrDlouhy If you have an idea about how to fix this without reverting, it's welcome. Otherwise, I'm afraid we'll have to revert this as it seems the regression is at least as serious as the fix. |
I tried to fix this in #558. I don't understand the original issue fully, but this seems to be working. |
During implementation of this module, I noticed that in some use cases, I got stuck in an infinite login loop.
Expected Behavior
For step 4, I would expect a message stating that the page the user tries to access requires OTP and without the user having an OTP device, that this is not possible. OR) the user is being redirected to the OTP setup page, and after setting up the OTP, have the possibility to get back to the page where the user initially wanted to go to.
Note that this might be troublesome for body-related requests (e.g. POST/PUT), but I have the feeling (not confirmed from my side) that this is already the case for the current implementation.
Current Behavior
When going to an
otp_required
-view, after signing in with a user without an OTP device, the user gets stuck in an infinite login-loop.Possible Solution
I would say that an else-clause could be useful in core.py#L160.
I will create a pull request with the suggested change and updated tests.
The only question I have, right now, is the following: since this change will introduce a 'breaking change' (in the sense of user-flow), please advise whether it should be configureable or not. I tend to say no, since this feels like a user-workflow related bug; but I prefer the maintainers to have an opinion on this.
Steps to Reproduce (for bugs)
@otp_required
view - for making sure that it is not related to my Django instance, I could reproduce it on a clean-freshly installed Django project/account/login/?next={view_url}
/account/login/
page, with the same?next={view_url}
Context
It affects me because I have a few dozen users of my app, who are now in a loop of logging in, coming to me, and I need to explain them to go to the OTP setup page.
Your Environment
The text was updated successfully, but these errors were encountered: