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);
TypeScript
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?
TL;DR
Error: Invalid Token when verifying TOTP MFA.
Developers are encountering issues with verifying TOTP MFA tokens, even though they are using the correct token from the Authenticator App. The provided code snippets show functions for creating and activating MFA.
Solution:
- Double-check that the TOTP OTP (One-Time Password) being passed in the activateMFA function is correct.
- Ensure that the implementation of the createMFA and activateMFA functions is correct and matches the server-side MFA validation process.
- Troubleshoot any discrepancies between the creation of the QR code and the scanning process to ensure accurate encoding of the secretRecommended threads
- unlike any other provider, your sites DN...
your nameservers dont work with a funny little CNAME error, which is a weird bug but thats what you get when you try to be the kitchen sink, funny errors.
- Weird Table Causes Console to break
I dont even know how this even happened looks like the $createdAt and , $id got switched? <@831428608895615056>
- I recently switched to TablesDb. When li...
olddb.list_documents( queries =[ Query.order_desc("timestamp"), Query.equal("isPosted",[False]) ] ) Above works fine and reruns documents But below don't return...