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

Unhandled exception #717

Open patroqueeet opened 8 months ago

patroqueeet commented 8 months ago

Dear

this line could return None

https://github.com/jazzband/django-two-factor-auth/blob/4e71d977095023336233a32c7ee1cbb88a3af365/two_factor/views/core.py#L589

which will fail in the next line with:

Screenshot 2024-03-26 at 12 54 12

which will then show the user a 500 error and break his/her flow...

moggers87 commented 8 months ago

Please include as many relevant details about the environment you experienced the bug in:

If you can, also provide steps to reproduce this bug.

patroqueeet commented 7 months ago

@moggers87 I provided exact code path to your repo and the logic fail explanation. did you even try to understand? there is no need to provide the details you asked for, the error is obvious.

moggers87 commented 7 months ago

Your bug report is very unclear. Is this a theoretical issue as we're not guarding against get_method returning None or have you actually seen this exception happen? If it's the latter, steps to reproduce the exception are required.

patroqueeet commented 7 months ago

Good morning, the above screenshot is from Sentry for a PROD system. So indeed it truly happens. If that helps (but I don't see how):py 3.11, dj 4.1, otp 1.3, tfa 1.16.0. steps to reproduce are unclear as I don't know what the user did. Browser was Samsung Internet on Android.

patroqueeet commented 6 months ago

good morning, pls note. it just happened once more. again on a Samsung android device 🤔 - pls let me know, once its released, then I can report back if it keeps happening. maybe with more precise debugging information.