fix(users): show password validation errors - #43191
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #43191 +/- ##
=======================================
Coverage 66.64% 66.65%
=======================================
Files 2873 2873
Lines 163628 163629 +1
Branches 37767 37769 +2
=======================================
+ Hits 109052 109066 +14
+ Misses 52447 52434 -13
Partials 2129 2129
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Code Review Agent Run #93627aActionable Suggestions - 0Filtered by Review RulesBito filtered these suggestions based on rules created automatically for your feedback. Manage rules.
Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
SUMMARY
Surface field-level validation messages returned by the user API for HTTP 400 responses. Flask-AppBuilder uses 400 for Marshmallow validation errors such as password-complexity failures, while duplicate username/email database errors remain 422 and retain their existing friendly messages.
This keeps the API's established status-code contract intact rather than changing a shared Flask-AppBuilder endpoint. Client-side password-complexity checks are intentionally not duplicated because minimum length and blocklists are operator-configurable server policy.
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
Before: Submitting a password shorter than the configured minimum showed the generic red toast: “There was an error creating the user. Please, try again.”
After: The same submission shows the server-provided reason in the red toast: “Password must be at least 8 characters long.” (The number follows the server's configured policy.)
TESTING INSTRUCTIONS
Automated test:
The focused Jest suite passes (3 tests). Pre-commit formatting, linting, custom rules, and style checks pass. The targeted type-check hook cannot complete in this fresh worktree because generated
packages/*/libdeclarations have not been built; its reported errors are in unrelated existing files.ADDITIONAL INFORMATION