feat(confidence-engine): establish authenticated product boundary

This commit is contained in:
2026-09-08 16:30:07 +01:00
parent 1c17452bee
commit 30bf44f2e5
22 changed files with 487 additions and 8 deletions
+13
View File
@@ -0,0 +1,13 @@
import { getAuthenticatedUser } from "@/lib/supabase/server.js";
export function unauthorizedResponse() {
return Response.json({ error: "Unauthorized" }, { status: 401 });
}
export function withAuthenticatedApi(handler) {
return async function authenticatedApiHandler(request, context) {
const user = await getAuthenticatedUser();
if (!user) return unauthorizedResponse();
return handler(request, context);
};
}