-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
fix(mfa): Add types to allauth.mfa
flows
#3866
Conversation
2a59ebe
to
7b16e50
Compare
34569f5
to
7552540
Compare
Meanwhile, I have added mypy checking to the build, as adding type hints without enforcing them easily leads to errors. This did cause conflicts with your changes though. Can you please rebase? Thanks. |
Done, let's see if it passes! 🤞
Tangentially: I know we've talked about Ruff before and I know how you feel about it, but it was pretty useful here, as the ANN series of rules can narrow down places that are missing annotations, and a human can then figure them out. |
@pennersr On that note, what's your stance on using |
This PR adds a bunch of types to
allauth.mfa
's internals.Our app needs to set up MFA with a slightly custom flow, so we can't use the forms or headless features, so I needed to delve a bit into how things work under the hood, and figured it'd be useful if types were documented technically too, for IDEs etc.
Feels like
TOTP
andRecoveryCodes
should have a superclass, but that's beyond the scope of this PR...