I encountered an issue while attempting to implement custom sign up and login functionality in Anvil. To create a new authentication method, I used the following code on the client side, However, the add_mfa_method
function raised an error:
What I’ve tried and what’s not working:
email = 'test@test.com'
password = '123456'
totp_secret = anvil.users.mfa.generate_totp_secret(email)
anvil.users.mfa.add_mfa_method(password, totp_secret['mfa_method'], True)
error:
anvil.users.AuthenticationFailed: Incorrect password
called from anvil-services/anvil/users/mfa/__init__.py:95