v2: household settings page + native setup-account flow#1111
Merged
Conversation
Add a Household section to the v2 settings modal that lists family members and lets the admin invite them to sign in. Mirrors the v1 admin flow: create a member (name + optional email), optionally create a login, get a one-time setup URL to share, copy to clipboard. - types.ts: LoginAccount + LoginAccountRole - queries/users.ts: create/update/delete user, list/create/regenerate/delete login mutations, plus setupAccountURL helper - features/settings/household-section.tsx: member list, add-member dialog, per-member kebab menu (invite, reset password, remove login, delete member), share-link dialog with copy button, delete confirmation Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Setup links now point at /v2/setup-account/<token> instead of the v1 admin form. New page greets the member by email, takes a password + confirm, sets it via POST /web/v1/setup-account/<token>, and opens a session so the SPA navigates straight into /v2/. Three branches handled: valid token → form, invalid/expired → SETUP_TOKEN_INVALID card, already setup → bounce to /login. Also moves the Add Member primary button out of the settings dialog header (it was overlapping the close X) into the section body below the description. - web/embed.go: SetupAccountInfoHandler (GET) + SetupAccountHandler (POST) - internal/api/router.go: mount both pre-auth under /web/v1 - web/src/api/queries/auth.ts: useSetupAccountInfo / useSetupAccount - web/src/routes/setup-account.tsx: the new page - web/src/routes/__root.tsx: exempt /setup-account/* from the auth gate - web/src/main.tsx: register the route - web/src/features/settings/household-section.tsx: move the primary action - web/src/api/queries/users.ts: setupAccountURL → /v2/setup-account/<token> Legacy /setup-account/<token> remains mounted so tokens already in the wild keep working. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
00359aa to
2ac699d
Compare
4 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
/setup-account/<token>admin form with a v2-native setup page at/v2/setup-account/<token>. Greets the new member by email, takes their password, and signs them straight into/v2/. Pre-auth JSON endpoints under/web/v1/setup-account/{token}back it.Legacy
/setup-account/<token>admin route stays mounted so previously-issued tokens keep working.Screens
Household section — desktop / tablet / mobile
Setup-account page — what a new member sees on the share link
Flow
setup_token. SPA shows a copy-able link to/v2/setup-account/<token>.GET /web/v1/setup-account/<token>→ renders form, orSETUP_TOKEN_INVALID/ALREADY_SETUPcards.POST /web/v1/setup-account/<token>hashes + stores it, clears the token, opens a session, returns{account_id, username, role}. SPA navigates to/v2/.Test plan
bun run lint(tsc --noEmit) cleanbun run build(vite production build) cleango build ./...clean/v2/setup-account/<token>URL/v2/make build && ./breadbox serve(embedded SPA path) one more time before merge🤖 Generated with Claude Code