Login page, forced password change, admin user management (R2) #12

Merged
weichen merged 1 commits from feature/auth-admin-accounts into main 2026-09-30 11:17:04 +00:00
Owner

Why: admin-issued accounts (2026-09-30): login page with password + API-key tabs; first login after initial/reset password must change before entering; admins manage users.

Evidence: headless journey on the real binary (--auth on): CLI bootstrap admin -> forced change -> app; admin creates bob; bob sees no user management; alice CLI reset -> forced change again; API-key tab; logout; zero console errors. Fixed real bug: setState updater captured e.currentTarget after React nulls it (menus never rendered). npm build + vitest + make test green.

Impact: replaces API-key-only LoginGate; embedded mode unchanged. Depends: Backend PR (auth APIs).

Why: admin-issued accounts (2026-09-30): login page with password + API-key tabs; first login after initial/reset password must change before entering; admins manage users. Evidence: headless journey on the real binary (--auth on): CLI bootstrap admin -> forced change -> app; admin creates bob; bob sees no user management; alice CLI reset -> forced change again; API-key tab; logout; zero console errors. Fixed real bug: setState updater captured e.currentTarget after React nulls it (menus never rendered). npm build + vitest + make test green. Impact: replaces API-key-only LoginGate; embedded mode unchanged. Depends: Backend PR (auth APIs).
weichen added 1 commit 2026-09-30 11:16:50 +00:00
Why: accounts are admin-issued (user decision 2026-09-30, no self
registration); initial and admin-reset passwords must force a change on
first login.

Evidence:
- LoginPage: password (primary) + API key tabs; ChangePasswordGate
  blocks the app until the forced change completes (mismatch/length
  validation inline); App auth state machine checking -> login ->
  mustchange -> ok, session cookie flows through fetch automatically.
- Account menu gains change-password and admin-only user management;
  AdminUsersModal: create account (random initial password generator,
  admin checkbox), reset password, status table (ADMIN/USER, pending
  change chips).
- Fixed a real bug found in the headless walk: menu toggles passed
  e.currentTarget into the setState updater where React nulls it by
  render time, so anchor was null and the menu never rendered; capture
  the element before the updater.
- Headless journey on the real binary with --auth on: admin bootstrap
  via CLI -> first-login forced change -> app; admin creates bob (bob
  sees no user management); alice reset via CLI -> forced change on
  next login; API-key tab login; logout; zero console errors. npm run
  build + vitest green; make test full suite exit 0.

Impact: replaces the old API-key-only LoginGate; embedded no-auth mode
unchanged (no login page shown).

Refs: proposal 2026-09-30-ui-redesign-and-auth.md section 5 (R2,
admin-issued variant)
weichen force-pushed feature/auth-admin-accounts from 413e6ff15c to 1d6b8a64a6 2026-09-30 11:16:50 +00:00 Compare
weichen merged commit 2516df5b3b into main 2026-09-30 11:17:04 +00:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: weichen/Agent-System-Frontend#12