Back

Error 401 (user_invalid_token) under TOTP verification

  • 0
  • Web
sokratesli
2 Apr, 2024, 04:45

I am still failing to implement the TOTP-MFA.

TypeScript
    AuthenticatorType.Totp, // type
    '<OTP>' // otp
);```

```Error: 401 - "Invalid token passed in the request.".```

Is there an instruction in which order you have to create the TOTP for?

e.g.
1. createMfaAuthenticator
2. updateMfaAuthenticator
3. account.updateMFA (false -> true)?

Thank you very much.

Translated with DeepL.com (free version)
TL;DR
Issue: Developer facing error 401 (user_invalid_token) while implementing TOTP-MFA. Solution: It seems the order of creating TOTP might be incorrect. Try creating the MFA authenticator first using `createMfaAuthenticator`, then update it using `updateMfaAuthenticator`, and finally set the MFA as true on the account.
Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more