Self-service account management and public profiles - #51
Merged
Conversation
Extends the already-shipped PATCH/DELETE /api/v1/users/:id API with username and email editing, current-password verification before a password change, OAuth accounts setting an initial password, and cascade-deleting a user's posts/comments/likes on account deletion. Deletion requires re-entering the password (or, for OAuth-only accounts, typing the username) as confirmation. Adds the client side that never existed for this API: /account (self, editable) and /users/:id (anyone, read-only), reached by making every username byline in the app clickable.
Password fields (login, signup, account update/delete) were plain text inputs showing the value in the clear, and AutoForm rendered labels as raw camelCase schema keys (e.g. "currentPassword"). Adds a shared PasswordInput with a show/hide toggle used everywhere a password is entered, and humanizes AutoForm's field labels.
3 tasks
ChatRoom.test.tsx's render wrapper was typed as typeof rtlRender, whose generic overloads don't survive a plain arrow-function assignment. Typed it explicitly against ReactElement/RenderOptions instead. The cascade-delete test's postService.create calls were missing tags, required by CreatePost's inferred (post-default) type even though the schema defaults it at parse time.
2 tasks
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
PATCH/DELETE /api/v1/users/:idAPI with username and email editing, current-password verification before a password change, OAuth accounts setting an initial password, and cascade-deleting a user's posts/comments/likes on account deletion./account(self, editable) and/users/:id(anyone, read-only), reached by making every username byline in the app clickable.AutoFormrendered raw camelCase schema keys as labels (e.g.currentPassword). Adds a sharedPasswordInputwith a show/hide toggle used on login, signup, and account update/delete, and humanizesAutoForm's labels.Test plan
npm run test— 475 passing (server + client)docker compose watch: account edit (username/email/bio/password), OAuth-account password set, account deletion with cascade, public profile view