n8n
n8n copied to clipboard
Two-Factor Authentication Not Working After Update
Bug Description
I have self-hosted n8n using Docker, and starting today, two-factor authentication (2FA) has stopped working. I had to disable it via the command line to regain access. When I tried to re-enable it, I kept getting the following error message: "Two-factor code failed. Please try again."
I never had this issue with previous versions of n8n. I only noticed the problem today, a few days after updating my Docker to the latest n8n version. Additionally, the recovery codes I had saved when I first enabled 2FA no longer worked either.
To Reproduce
- Update n8n (self-hosted via Docker) to the latest version.
- Log in using two-factor authentication.
- Enter the correct 2FA code from an authenticator app.
- Observe the error message: "Two-factor code failed. Please try again."
- Try using recovery codes—none of them work.
- Disable 2FA via the command line to regain access.
- Attempt to re-enable 2FA and enter the new code—still fails with the same error.
Expected behavior
2FA to work properly
Operating System
Ubuntu Linux 22.04
n8n Version
1.78.0
Node.js Version
18.16.0
Database
SQLite (default)
Execution mode
main (default)