v0.71.0: admin panel — users table, login/sessions, generic DB CRUD modal
CI / build + unit + e2e (pull_request) Failing after 13m35s
CI / build + unit + e2e (pull_request) Failing after 13m35s
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
import { currentUser } from '@/lib/auth';
|
||||
|
||||
// v0.71.0 — GET /api/me (no body). Returns the user behind a valid X-Flight-Session header as
|
||||
// { username, admin }, or 401 when the header is missing/unknown/expired. The client uses it to
|
||||
// decide what the Admin modal shows on open.
|
||||
|
||||
export async function GET(req: Request) {
|
||||
const user = await currentUser(req);
|
||||
if (!user) return Response.json({ error: 'authentication required' }, { status: 401 });
|
||||
return Response.json({ username: user.username, admin: user.admin });
|
||||
}
|
||||
Reference in New Issue
Block a user