lookit / lookit-api

Codebase for Lookit v2 and Experimenter v2. Includes an API. Docs: http://lookit.readthedocs.io/
https://lookit.mit.edu/
MIT License
10 stars 18 forks source link

Sentry: AttributeError /2fa-login/ #1411

Closed okaycj closed 2 months ago

okaycj commented 2 months ago

Summary

Sentry Issue

This PR adds a check before verifying OTP. I am not entirely sure why this is happening, but it's simple enough to check if the OTP object not None before the verify.

sonarcloud[bot] commented 2 months ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

becky-gilbert commented 2 months ago

I'm guessing we don't know how to reproduce the problem? I wish we knew why self.otp can be None to make sure that this is the right way to handle it.

The check makes sense, but I wonder if this is just going to cause a different downstream Sentry error since clean_otp_code will return nothing in this case. Should we throw an error?