feat: complete MVP foundation auth and dashboard

This commit is contained in:
2026-06-04 09:05:40 +02:00
parent 20615e12a1
commit df7a955736
32 changed files with 880 additions and 139 deletions

21
proxy.ts Normal file
View File

@@ -0,0 +1,21 @@
import { NextResponse, type NextRequest } from "next/server";
import { MOCK_SESSION_COOKIE_NAME } from "@/lib/mock-auth";
import { shouldRedirectDashboardRequest } from "@/lib/proxy-auth";
export function proxy(request: NextRequest) {
if (
shouldRedirectDashboardRequest(
request.nextUrl.pathname,
request.cookies.get(MOCK_SESSION_COOKIE_NAME)?.value,
)
) {
return NextResponse.redirect(new URL("/", request.url));
}
return NextResponse.next();
}
export const config = {
matcher: "/dashboard/:path*",
};