import { NextResponse, type NextRequest } from "next/server"; import { isAuthenticated } from "@/lib/auth-server"; import { shouldRedirectDashboardRequest } from "@/lib/route-guards"; export async function proxy(request: NextRequest) { const hasSession = await isAuthenticated(); if (shouldRedirectDashboardRequest(request.nextUrl.pathname, hasSession)) { return NextResponse.redirect(new URL("/login", request.url)); } return NextResponse.next(); } export const config = { matcher: ["/dashboard/:path*"], };