fix: align password change dialogs#969
Merged
Merged
Conversation
Add coverage for the /users/me/password flow and fix the frontend payload shape. Also improve browser autofill behavior across password-related dialogs and add consistent success feedback in user management.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR aligns the password-change UI flows with the backend API and improves UX for password-related dialogs by standardizing payload shape, adding autofill hints, and providing consistent success feedback. It also adds a backend router test to cover the /api/users/me/password endpoint.
Changes:
- Fix
/api/users/me/passwordrequest payload keys tooldPassword/newPassword(matching the backend contract). - Add
name/autoCompleteattributes across user/password dialogs to improve browser/password-manager autofill behavior. - Add router test coverage for changing a user’s own password and verifying old-password login fails while new-password login succeeds.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| ui/leafwiki-ui/src/lib/api/users.ts | Updates changeOwnPassword payload shape to match backend JSON fields. |
| ui/leafwiki-ui/src/features/users/UserFormDialog.tsx | Adds name and autoComplete hints to user create/edit inputs. |
| ui/leafwiki-ui/src/features/users/ChangePasswordDialog.tsx | Adds success toast + autofill-related hidden username field and input attributes. |
| ui/leafwiki-ui/src/features/users/ChangeOwnPasswordDialog.tsx | Adds autofill-related hidden username field and input attributes; adjusts dialog default action behavior. |
| ui/leafwiki-ui/src/components/FormInput.tsx | Extends reusable input component to support name and autoComplete. |
| internal/http/router_test.go | Adds test coverage for /api/users/me/password flow. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Close open dialogs before using the user toolbar during Playwright cleanup so modal overlays do not block logout clicks in afterEach hooks.
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.
Add coverage for the /users/me/password flow and fix the frontend payload shape. Also improve browser autofill behavior across password-related dialogs and add consistent success feedback in user management.