Fix: changepassword validation. Closes #951#963
Fix: changepassword validation. Closes #951#963regulartim merged 4 commits intoGreedyBear-Project:developfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR aligns the Change Password form with the shared auth validators, adds a reusable show-password toggle hook/component across auth-related forms, and replaces toast-based validation errors with inline form errors (closing #951).
Changes:
- Refactors ChangePassword validation to use
PasswordValidator,ComparePassword, and newOldNewPasswordValidator, and enablesvalidateOnMount. - Introduces
usePasswordVisibility+ShowPasswordToggleand adopts them in Login/Register/ResetPassword/ChangePassword. - Updates/adds frontend tests to cover the new toggle behavior and inline validation errors.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| frontend/src/components/me/changepassword/ChangePassword.jsx | Switches to shared validators, adds inline errors and show-password toggle support. |
| frontend/src/components/auth/utils/validator.jsx | Adds OldNewPasswordValidator for “old vs new password” comparison. |
| frontend/src/components/common/ShowPasswordToggle.jsx | Adds reusable show-password toggle component and visibility hook. |
| frontend/src/components/auth/Login.jsx | Replaces local checkbox state with shared password visibility hook/component. |
| frontend/src/components/auth/Register.jsx | Replaces local checkbox state with shared password visibility hook/component. |
| frontend/src/components/auth/ResetPassword.jsx | Replaces local checkbox state with shared password visibility hook/component. |
| frontend/tests/components/me/changepassword/ChangePassword.test.jsx | Updates tests for inline errors and show-password toggle behavior in ChangePassword. |
| frontend/tests/components/common/ShowPasswordToggle.test.jsx | Adds unit tests for the new toggle component and visibility hook. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 8 out of 8 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Hi @regulartim , Please take a look into this when you have time and tell me if there's anything I need to do. |
regulartim
left a comment
There was a problem hiding this comment.
Looks good, thank you! :)
Description
validator.tsxand add a new validationOldNewPasswordValidatorto check whether the old and new password match or empty.Related issues
Closes #951
Type of change
Checklist
Please complete this checklist carefully. It helps guide your contribution and lets maintainers verify that all requirements are met.
Formalities
<feature name>. Closes #999develop.develop.Docs and tests
Ruff) gave 0 errors. If you have correctly installed pre-commit, it does these checks and adjustments on your behalf.