first commit

This commit is contained in:
2026-07-12 15:55:18 +05:30
commit ee98026cc5
404 changed files with 44522 additions and 0 deletions
+11
View File
@@ -0,0 +1,11 @@
// API route: GET /api/me. Protected by requireAuth — returns 401 when anonymous,
// otherwise the current user hydrated onto ctx by the auth middleware.
import { requireAuth, getUser, type Context } from "@wrnexus/core";
const guard = requireAuth();
export async function GET(ctx: Context): Promise<Response> {
const denied = await guard(ctx, () => new Response(null));
if (denied.status === 401) return denied;
return Response.json({ ok: true, user: getUser(ctx) });
}