
Hello everyone!
I'm trying to implement TFA in my angular app, but it seems that i'm doing something wrong somewhere. Can anyone help me verify why my code ain't working? So far i have followed this flow: createMfaAuthenticator -> updateMfaAuthenticator (but the otp code is always incorrect according to appwrite) -> createMfaRecoveryCodes -> updateMFA. Here's my code:
generateSecret() {
return from(this.account.createMfaAuthenticator());
}
generateRecoveryCodes(otp: string) {
return from(this.account.updateMfaAuthenticator(otp)).pipe(
switchMap(() => {
return from(this.account.createMfaRecoveryCodes());
})
);
}
enable() {
return from(this.account.updateMFA(true));
}
Also im pretty sure there's no calling otp twice, the secret is being generated only once. That can be seen in the network tab, only one PUT otp call , the other one is an OPTIONS call. So, anybody have any ideia?

Recommended threads
- Ability to mark user as "Verified" when ...
I’m using Google Sign-In in my bare React-native app and verifying the user's email through Google OAuth. After verifying the token server-side, I create the us...
- grant permisions only to users in collec...
I'm building a web app and instead of using Appwrite Auth, I made my own custom auth system that stores user data in documents. I have a "Profile" page where lo...
- Flutter native Google Sign Up with googl...
Hey I want to use the native login instead of the WebView. Do you have any experience on that and has Appwrite to plan this support?
