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
- Showing appwrite login page
When I set custom domain to my appwrite, and I send an api request from website, server api directing me to the appwrite login page. Is there a way to prevent t...
- failed, reason: connect ECONNREFUSED
Hello I'm wondering why this happen, I'm just looping for getting data. And got this.
- Project migration cloud to selfhosted
Migration of a small cloud project I have to my self-hosted instance (`1.5.11`) fails. The project data in the project isn't that much. Data available in cloud...