Its_MS
I am trying to generate a QRCode for my 2FA, it generates the qrcode, I can add it to my authenticator app, but then when I enter the passcode to verify it says AppwriteException: Invalid token passed in the request.
This is my code if anyone could help?
TypeScript
// ============================== ADD AUTHENTICATOR
export async function startAddAuthenticator() {
try {
const result1 = await account.createMfaAuthenticator(
AuthenticatorType.Totp // type
);
if (!result1) return null;
const qr = avatars.getQR(result1.uri, 800, 0, false);
return { qr, secret: result1.secret };
} catch (error) {
console.log(error);
}
}
// ============================== VERIFY AUTHENTICATOR
export async function verifyAuthenticator(code: string) {
try {
const result = await account.updateMfaAuthenticator(
AuthenticatorType.Totp, // type
code // code
);
if (!result) return null;
return result;
} catch (error) {
console.log(error);
}
}
TL;DR
Issue: Developer is facing an 'AppwriteException: Invalid token passed in the request' error when trying to verify the 2FA passcode generated by their authenticator app.
Solution: The issue likely lies in the way the code for generating and verifying the 2FA is implemented. Double-check the logic in the `verifyAuthenticator` function and ensure that the correct parameters are being passed for updating the MFA authenticator. Its_MS
2FA
Recommended threads
- Applying free credits on Github Student ...
So this post is kind of related to my old post where i was charged 15usd by mistake. This happens when you are trying to apply free credits you got from somewh...
- delete document problems
i don't know what's going on but i get an attribute "tournamentid" not found in the collection when i try to delet the document... but this is just the document...
- Attributes Confusion
```import 'package:appwrite/models.dart'; class OrdersModel { String id, email, name, phone, status, user_id, address; int discount, total, created_at; L...