feat(#180): self-service password change for customers and admins#182
Merged
Conversation
…ngle PasswordController) A signed-in account can change its own password. One DRY PasswordController serves both portals — /customer/password and /custodian/password — sharing a single change routine; only the rendered view (customer vs custodian navbar) differs. Accounts are unified RetailCustomerEntity rows by role, so the logic is identical. - Verifies the current password (BCrypt) before accepting the new one; requires new == confirm and non-blank; persists the BCrypt-encoded new password. A user can change only their own account (resolved from the authenticated principal). @PreAuthorize isAuthenticated. - Nav: "Change Password" in the customer navbar and the custodian user dropdown. - Templates: customer/password.html, custodian/password.html. Verified live: customer and admin change password; wrong-current and mismatch rejected; new password logs in, old password rejected; admin lands back on /custodian/home. datacustodian suite 160/0. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Lets any signed-in account change its own password, in both portals. Closes #180.
Design (DRY)
A single
PasswordControllerserves both/customer/passwordand/custodian/password, sharing one change routine — only the rendered view (customer vs custodian navbar) differs. Accounts are unifiedRetailCustomerEntityrows distinguished by role, so the logic is identical.new == confirmand non-blank; persists the BCrypt-encoded new password.@PreAuthorize("isAuthenticated()").Verification
Live: customer and admin change password; wrong-current and mismatch rejected with a clear message; the new password logs in and the old one is rejected; admin lands back on
/custodian/home.datacustodiansuite 160/0.🤖 Generated with Claude Code