
Hi, I always get the error messages that the token I pass is invalid although it is the one from the Authenticator App which has been added by scanning the QR code.
This is my code: async createMFA() { try { account.updateMFA(true);
const { secret, uri } = await account.createMfaAuthenticator(
AuthenticatorType.Totp // type
);
console.log("Authenticator URI:", uri, "Secret:", secret);
const result = await avatars.getQR(
uri, // text
800, // size (optional)
0, // margin (optional)
false // download (optional)
);
const qrString = result.toString();
console.log("QR Code String:", qrString);
return qrString
} catch (error) {
throw(error)
}
}
async activateMFA(OTP: string) {
try {
const result = await account.updateMfaAuthenticator(
AuthenticatorType.Totp, // type
OTP // otp
);
console.log(result);
if (result) {
const response = await account.updateMFA(true);
}
} catch (error) {
console.log('Error' + error)
}
}
Can someone help me please?
Recommended threads
- Exposing project id and endpoint on GitH...
Is it best practice to expose your project id and endpoint in your appwrite.js file when publishing an NextJS or Angular project. If you use a .env file, that i...
- Insights🐛 Bug Report: Missing Tables AP...
Hi. First time appwrite user. i'm building a new mobile app with react-native & expo and decided to use appwrite as a tech for this app. i found the react-nativ...
- CSV Import Shows Success but Data Not Ap...
I tried importing a CSV file into my PRODUCTS collection. The dashboard shows the message “Import to PRODUCTS completed successfully,” but no data appears in th...
