import { type NextRequest, NextResponse, type ProxyConfig } from "next/server" import { refreshAuth } from "@/actions/auth" export const config: ProxyConfig = { matcher: [ "/((?!api|_next/static|_next/image|.well-known|sw.js|favicon.ico|sitemap.xml|robots.txt).*(? request.nextUrl.pathname === path || request.nextUrl.pathname.startsWith(`${path}/`), ) if (!hasToken && isProtectedPath) { return NextResponse.redirect( `${request.nextUrl.origin}/login?redirect=${request.nextUrl.pathname}`, ) } return NextResponse.next({ request }) }