add_mfa_method(password, mfa_method, [clear_existing=False])
Add an MFA method to the current user by passing the user’s password and the mfa method, optionally clearing all existing methods.
Display a form for the user to configure 2-factor authentication.
allow_cancel: if True, the signup form has a Cancel button that the user can use to dismiss the form.
Generate a WebAuthn challenge that can be used to register a new hardware token for two-factor authentication.
Generate a TOTP secret that can be added as two-factor authentication for the current user.
Get the available MFA types for the given user by passing their email and password.
Generate a WebAuthn challenge that the given user can use to log in with a previously registered hardware token.
Get an MFA login object representing a TOTP login code. This can be passed to the login_with_email function as the mfa argument.
Display a form to collect two-factor authentication credentials from the user currently logging in by passing the function their email and password.
Validate the given TOTP code against the given MFA method from a User row.