
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
- Inconsistent Function Execution Times
Hi Appwrite Team, I'm experiencing inconsistent execution times with my functions, and I'd appreciate your insights. I've added detailed logs to my function t...
- Error when uploading the file
`Error uploading document: AppwriteException: document_invalid_structure, Invalid document structure: Unknown attribute: "id" (400)` The file is successfully u...
- Schema Redirect in RN/Expo doesn't work ...
Hello, I have implemented Google OAuth and Apple OAuth for my expo app. I was switching from Expo Go to `expo-dev-client` for some packages to be working, thou...
