
Hello
I want to set up the MFA for the user accounts in JS (react) and fail repeatedly (WebSDK appwrite 14.0 with appwrite 1.5.4.).
Instructions used: https://appwrite.io/docs/products/auth/2fa
Account created with updateMFA(true);
MFA page
useEffect(() => {
const generateTOTP = async () => {
try {
const response = await account.get();
} catch (error) {
console.log(error);
if (error.type === 'user_more_factors_required') {
const factors = await account.listFactors();
console.log("factors", factors)
const { backups, secret, uri } = await account.addAuthenticator('totp');
setBackups(backups);
setSecret(secret);
setUri(uri);
const QRCode = await avatars.getQR(uri);
setQrCode(QRCode);
console.log(QRCode.href);
const challenge = await account.createChallenge("totp");
setChallengeId(challenge.$id);
} else {
console.error(error);
}
}
};
generateTOTP();
}, []);
Error:
TypeError: account.listFactors is not a function
Is there a good example in JS?
What am I doing wrong?
Thank you very much for your help.
Recommended threads
- Subdomain failed verification
So I wanted to do a custom subdomain, because local storage doesn't work for me, but I've tried it a long time ago, it didn't work for me, and now I'm trying ag...
- [Node.js SDK] Bypass 2GB file limit?
Hello. Using either InputFile.fromPath or InputFile.fromBuffer throws this error: File size (2295467305) is greater than 2 GiB Bucket limit etc. is setup corre...
- Relationship null, even when relationshi...
Hi Everyone, im experiencing issues with set relation data. When im setting the document id from the related database most of them seem fine, except one table. ...
