Skip to content

Pick reset-password target from a list of existing users - #1065

Open
PatrickRose wants to merge 1 commit into
developfrom
feature/reset-password-user-list
Open

Pick reset-password target from a list of existing users#1065
PatrickRose wants to merge 1 commit into
developfrom
feature/reset-password-user-list

Conversation

@PatrickRose

Copy link
Copy Markdown
Owner

What

Follow-up to #1061. The admin reset-password page previously had a free-text username field; you had to type an exact username. This replaces it with a dropdown populated from the users currently on the system, so an admin selects who to reset.

Changes

  • src/server/repository/user/index.ts / mongo.ts — add a list() method to the user repository returning all usernames (fetched with a _id-only projection).
  • src/pages/api/user/list.ts — new login-gated GET endpoint returning { users: string[] }. Gated on isLoggedIn like the other admin routes, since a full user list is enumeration-sensitive (unlike the public /api/games).
  • src/types/io-ts-def.ts / types.d.tsUserListAPIDecode / UserListAPI.
  • src/pages/admin/reset-password.tsx — fetch the list with SWR and render it through the existing SelectInput component, with loading (Loading users...) and empty (There are no users to reset.) states. The submit path and forced-reset behaviour are unchanged.

Testing

  • next build succeeds; /api/user/list and /api/user/reset both compile as server routes
  • tsc --noEmit, eslint, and prettier --check (repo-pinned 3.9.4) all clean for the changed files

🤖 Generated with Claude Code

Replace the free-text username field on the admin reset-password page
with a dropdown populated from the users on the system.

- Add a `list()` method to the user repository returning all usernames
- Add a login-gated GET /api/user/list endpoint
- Fetch the list with SWR and render it via SelectInput, with loading
  and empty states

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@vercel

vercel Bot commented Jul 27, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
omega-website-5xmp Ready Ready Preview, Comment Jul 27, 2026 8:13am

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant