Repository navigation
MFA workflow fixes - #13241
MFA workflow fixes#13241
Conversation
SchrodingersGat
commented
Nov 10, 2026
- Fixes New users are blocked after enabling "Force MFA". #13238
- Verify email on successful password reset
- Invalidate password on account creation
- Fix MFA workflows
- Add regression tests
- Fixes inventree#13238 - Verify email on successful password reset - Invalidate password on account creation - Fix MFA workflows - Add regression tests
✅ Deploy Preview for inventree-web-pui-preview ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
🟡 Changes recommended
The new assertion uses substring label matching, which selects both otp-secret and otp-secret-container and causes a strict-mode failure; it needs an exact label match.
1 open issue
What changed in this PR
This PR addresses #13238 by repairing onboarding for administrator-created users when MFA is mandatory, including email verification and recovery from blocked MFA setup.
Changes:
- Verify a single matching email address after password reset and persist unusable passwords for new accounts.
- Add verification-email resend and retry controls to MFA setup.
- Add backend and frontend regression tests and document the workflow.
| File | Description |
|---|---|
src/frontend/tests/pui_login.spec.ts |
Tests email verification recovery during MFA setup. |
src/frontend/src/pages/Auth/MFASetup.tsx |
Adds verification guidance, resend, and retry controls. |
src/frontend/src/functions/auth.tsx |
Handles unverified-email errors and sends verification requests. |
src/backend/InvenTree/users/test_api.py |
Adds onboarding and password-reset verification tests. |
src/backend/InvenTree/users/serializers.py |
Saves the new account’s unusable password. |
src/backend/InvenTree/users/models.py |
Verifies eligible email addresses after password reset. |
docs/docs/settings/MFA.md |
Documents email verification requirements and recovery options. |
CHANGELOG.md |
Records the password-reset verification change. |
Review effort: Balanced
Codecov Report❌ Patch coverage is ❌ Your patch check has failed because the patch coverage (9.09%) is below the target coverage (80.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## master #13241 +/- ##
==========================================
- Coverage 90.19% 85.13% -5.07%
==========================================
Files 883 1076 +193
Lines 82311 92388 +10077
Branches 4251 4246 -5
==========================================
+ Hits 74240 78652 +4412
- Misses 7058 12731 +5673
+ Partials 1013 1005 -8
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
Co-authored-by: Copilot Autofix powered by AI <[email protected]>
💔 All backports failed
Manual backportTo create the backport manually run: Questions ?Please refer to the Backport tool documentation and see the Github Action logs for details |
* MFA workflow fixes - Fixes #13238 - Verify email on successful password reset - Invalidate password on account creation - Fix MFA workflows - Add regression tests * Update docs * Update OTP secret expectation to use exact match * Attempt to fix flaky test --------- Co-authored-by: Copilot Autofix powered by AI <[email protected]>

