Heb er een PWA van gemaakt en layout gecorrigeerd

This commit is contained in:
LogJurgenR
2026-08-19 16:46:29 +02:00
parent d3cab99d86
commit 686339325e
21 changed files with 1629 additions and 103 deletions
+20
View File
@@ -0,0 +1,20 @@
import { NextRequest, NextResponse } from "next/server";
import { SESSION_COOKIE } from "@/lib/auth";
export function proxy(request: NextRequest) {
const hasSession = request.cookies.get(SESSION_COOKIE)?.value === "authenticated";
if (request.nextUrl.pathname === "/" && !hasSession) {
return NextResponse.redirect(new URL("/login", request.url));
}
if (request.nextUrl.pathname === "/login" && hasSession) {
return NextResponse.redirect(new URL("/", request.url));
}
return NextResponse.next();
}
export const config = {
matcher: ["/", "/login"],
};