Repository navigation
Description
Please verify that this bug has NOT been raised before.
- I checked and didn't find a similar issue
Describe the bug*
Force MFA option makes it impossible to register new users.
Tested with Safari, Opera, and Firefox.
Not reproducible on the InvenTree demo site because the "Force MFA" option is disabled.
The problem is that when you create a new user, their email address is marked as "unvalidated". The new user can't register MFA without a valid email address, but they can't validate their email without setting up MFA.@Jiri Vyskocilil there is a workaround for now.
1. Create a new user
2. Go to https://inventree.advantics.com/admin/account/emailaddress/
3. Click on the new user's email
4. Tick “validated”
5. Click “Save”
Then the new user can set up MFA and log in.
Steps to Reproduce
-
Admin switches “Force MFA” on in settings.
-
Created a new user.
-
New user receives an email with a link to Inventree, then clicks on the “reset password” function.
-
New user receives a second email with a unique "password reset" link
-
New user follows link in password reset email.
-
Webpage returns only:
{"id": "mfa_register", "error": "You must enable two-factor authentication before doing anything else."} -
New user clicks "back" button then "refresh".
-
Browser shows partially loaded (broken) MFA registration page with space for QR code but no QR code.
Expected behaviour
New user should be able to register MFA on their first login.
Workaround:
- After creating the new user account, administrator can go to https:///admin/account/emailaddress/
- Click on new user's email address
- Tick "validated"
- Click "Save" button
Deployment Method
Docker
Version Information
InvenTree-Version: 1.7.1
Django Version: 5.2.17
Commit Hash: 7507c45
Commit Date: 2026-11-08
Commit Branch: null
Database: django.db.backends.postgresql
Debug-Mode: False
Deployed using Docker: True
Platform: Linux-6.12.116+deb13-amd64-x86_64-with-glibc2.41
Installer: DOC
Active plugins: [{"name":"InvenTreeBarcode","slug":"inventreebarcode","version":"2.2.0"},{"name":"BOM Exporter","slug":"bom-exporter","version":"1.1.0"},{"name":"InvenTree Exporter","slug":"inventree-exporter","version":"1.0.0"},{"name":"Parameter Exporter","slug":"parameter-exporter","version":"2.0.0"},{"name":"InvenTreeEmailNotifications","slug":"inventree-email-notification","version":"1.0.0"},{"name":"InvenTreeUINotifications","slug":"inventree-ui-notification","version":"1.0.0"},{"name":"InvenTreeWellKnown","slug":"inventree-well-known","version":"1.0.0"},{"name":"InvenTreeCurrencyExchange","slug":"inventreecurrencyexchange","version":"1.0.0"},{"name":"InvenTreeMachines","slug":"inventree-machines","version":"1.0.0"},{"name":"InvenTreeLabel","slug":"inventreelabel","version":"1.1.0"},{"name":"InvenTreeLabelMachine","slug":"inventreelabelmachine","version":"1.0.0"},{"name":"InvenTreeLabelSheet","slug":"inventreelabelsheet","version":"1.0.1"},{"name":"DigiKeyBarcodePlugin","slug":"digikeyplugin","version":"1.0.1"},{"name":"LCSCBarcodePlugin","slug":"lcscplugin","version":"1.0.1"},{"name":"MouserBarcodePlugin","slug":"mouserplugin","version":"1.0.1"},{"name":"TMEBarcodePlugin","slug":"tmeplugin","version":"1.0.1"},{"name":"AdvancedLabelSheet","slug":"advancedlabelsheet","version":"1.4.0"},{"name":"KiCadLibraryPlugin","slug":"kicad-library-plugin","version":"2.1.0"}]
Try to reproduce on the demo site
I tried to reproduce
Is the bug reproducible on the demo site?
Not reproducible
Relevant log output
I have reviewed this report for correctness and filled out all sections.
- I have checked this report. I acknowledge that filing bugs via AI agents without review might lead to being blocked.
Activity
newfolder0 commentedon Nov 9, 2026
With a bit of help from Claude AI, the problem seems to be that users with an unvalidated email address can't be served the MFA registration page.
@ timaraxian
SchrodingersGat commentedon Nov 10, 2026
@newfolder0 thanks for reporting. Potential fix incoming in #13241 - would you be able to test this?
timaraxian commentedon Nov 10, 2026
Hi @SchrodingersGat, I'm one of @newfolder0's colleagues. I'm just confirming the changes in #13241 work for me.
Cheers
newfolder0 commentedon Nov 10, 2026
Rad, thanks both for knocking this over so quickly!
I trust @timaraxian 's test and I don't have time to test it myself today - should I close the bug now, or wait until I've tested it myself (can do tomorrow, sorry for the delay) and/or it's released in the latest "stable" ?
MFA workflow fixes (inventree#13241)
MFA workflow fixes (#13241) (#13277)