
I am encoutering the more factors error even though I am providing proper mfa code in the workflow.
The following happens:
- User provides email adress
- User receives the email with the proper callback link and secret
- User gets authenticated and is prompted to provide mfa code (also via email)
- User provides the mfa code and instead of being logged in the mfa component errors requesting more factors
What works: a) Magic URL with disabled mfa b) Email/Password with or without mfa (same mfa component/code as for the magic url). Here the code is send in the same way and upon providing it the user is properly logged in.
Since all parts are working individually or in a different context/combination I am at a loss at what more to try. Help is greatly appreciated.
As this is proprietary code I have no reproduction at hand, but can make one if that makes a different
password is using: account.createEmailPasswordSession
magic is using: account.updateMagicURLSession
mfa is using: account.updateMfaChallenge

@blackfan23 you're clearly following the correct flow, and it's helpful that MFA works with password sessions but fails specifically when used with Magic URL + MFA. Let's walk through what’s likely happening and what to check.
From your steps:
- ✅
account.createMagicURLSession()
(user gets link) - ✅ User clicks link →
account.updateMagicURLSession()
— success - ✅ Appwrite triggers MFA → sends 6-digit email code
- ❌
account.updateMfaChallenge()
is called with the code - 🔴 Error: "More factors required" (even though you just provided the only expected factor)
What Might Be Going Wrong
✅ You're probably authenticating the Magic URL session but not fully attaching the session token or not updating the session context before calling updateMfaChallenge
.
Appwrite uses cookies/tokens to associate the current session context with the MFA challenge. When using magic links, the updateMagicURLSession
returns a session object that includes a userId
and likely a cookie-based session (if running in browser), or token if using custom headers.
If updateMfaChallenge()
is being called:
- Outside of the same session context (e.g. missing token or cookie)
- Or before Appwrite associates the magic link with the MFA challenge properly
…it may treat it as an incomplete session and return the "more factors required" error.
Fix Checklist
- Ensure token/session from
updateMagicURLSession()
is set- If using Web SDK: make sure cookies are preserved (i.e., not calling via API manually)
- If using SSR/Node or custom flow: store the session token and reattach it to the client using:
account.updateSession('SESSION_ID');

- Verify that MFA challenge is being attached to that session
- The challenge from
account.createMfaChallenge()
needs to be consumed in the same session that was just authenticated from the magic link. - You may need to store and reuse the returned
challengeId
if applicable (depending on your version of Appwrite SDK).
- The challenge from

- Confirm that only 1 MFA factor is required
- Sometimes the error "More factors required" actually means "this factor wasn't enough" — double-check in the Appwrite console that your project has only 1 MFA factor required (e.g., just email, not email + TOTP).

Suggested Debugging Strategy
To isolate the issue:
- Log the session after updateMagicURLSession()
- Log the response of createMfaChallenge()
Try manually calling get() right before updateMfaChallenge() to confirm you're authenticated:
const session = await account.get();
Recommended threads
- ATTRIBUTE NOT SHOWING DELETE
Hi, I'm trying to delete an attribute in my collection but it won't delete, It's not even showing the delete when I click on the hamburger icon, Its showing onl...
- Email Verification Error
I am trying to make a registration flow for the next.js using node-appwriter sdk as SSR. I am trying to add email verification but isn't working giving some err...
- AppwriteException: Missing required para...
I'm having a problem accessing my users collection to list all my users. I was having trouble creating users but it has been resolved. I'm using react/nodejs on...
