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
- How to Avoid Double Requests in function...
I'm currently using Appwrite's `functions.createExecution` in my project. I want to avoid double requests when multiple actions (like searching or pagination) a...
- Send Email Verification With REST
I am using REST to create a user on the server side after receiving form data from the client. After the account is successfully created i wanted to send the v...
- Use different email hosts for different ...
Hello, I have 2 projects and i want to be able to set up email templates in the projects. Both projects will have different email host configurations. I see ...