Add admin foundation + Users resource (Filament replacement, slice 1)

Plain App Router admin (aligned to habbo-next, no Refine):
- rank surfaced on the NextAuth session; staff guard isStaff() [pure,
  unit-tested] + requireStaff() reading min_staff_rank, gating /admin.
- /admin dashboard (counts), /admin/users (paginated + search),
  /admin/users/[id] detail.
- src/actions/admin-users.ts: staff-gated server actions wiring the user editor
  to the existing services — giveCurrency (RCON or DB fallback), setMotto/setRank
  (DB + RCON), alertUser, disconnectUser.

Verified: tsc exit 0, vitest 45/45, next build exit 0 (/admin routes).
This commit is contained in:
Simo committed 2026-06-27 16:51:47 +02:00
1 parent d9a8ce532f
commit 9f81096f05
10 files changed
+334 -3

No files matched your search

+7 -1
View File
@@ -2,6 +2,12 @@ import type { DefaultSession } from "next-auth";
declare module "next-auth" {
interface Session {
user: { id: string } & DefaultSession["user"];
user: { id: string; rank: number } & DefaultSession["user"];
}
}
declare module "next-auth/jwt" {
interface JWT {
rank?: number;
}
}