--- type: User Story title: Manage users as an administrator description: Authorized operators search users and maintain their names, linked accounts, primaries, and Discord nicknames. tags: [admin, users, minecraft, discord] timestamp: 2026-08-01T18:43:58Z story_id: US-013 status: verified --- # User Story As an administrator, I want to manage a user's identity and Minecraft accounts, so that support issues can be resolved without direct database access. # Acceptance Criteria - [x] Administrators can search by preferred name, Discord username or ID, Minecraft username, or UUID. - [x] Search results show onboarding state, primary username, and active account count. - [x] A user detail view shows Discord identity, active accounts, recent events, and recent IP observations. - [x] Administrators can update the preferred name and synchronize Discord. - [x] Administrators can add Mojang-verified accounts or explicitly override an unverified username. - [x] Administrators can remove an account only after a visible confirmation step. - [x] Removing a primary account selects a replacement or falls back to the preferred-name nickname. - [x] Administrators can set a new primary account and automatically update Discord. - [x] Every action rechecks role and account ownership and records the acting administrator. - [x] Discord failures do not falsely persist the requested name, primary, or removal change. # Implementation - [`apps/web/src/app/admin/(console)/users/page.tsx`](../apps/web/src/app/admin/%28console%29/users/page.tsx) - [`apps/web/src/app/admin/(console)/users/[userId]/page.tsx`](../apps/web/src/app/admin/%28console%29/users/%5BuserId%5D/page.tsx) - [`apps/web/src/app/admin/(console)/users/actions.ts`](../apps/web/src/app/admin/%28console%29/users/actions.ts) # Validation Nickname fallback behavior is tested in [`packages/minecraft/test/minecraft.test.ts`](../packages/minecraft/test/minecraft.test.ts). Privileged routes pass TypeScript, lint, Semgrep, and production build checks. # Related Stories - [Administrator SSO](us-011-admin-sso.md) - [Synchronize Discord nicknames](us-006-discord-nickname.md)