(request: NextRequest)
| 8 | const PUBLIC_API_PREFIXES = ["/api/auth/", "/api/health"]; |
| 9 | |
| 10 | function isAuthenticated(request: NextRequest): boolean { |
| 11 | const authCookie = request.cookies.get("mc_auth"); |
| 12 | return !!(authCookie && authCookie.value === process.env.AUTH_SECRET); |
| 13 | } |
| 14 | |
| 15 | export function middleware(request: NextRequest) { |
| 16 | const { pathname } = request.nextUrl; |