import { NextResponse } from 'next/server'; import type { NextRequest } from 'next/server'; export function middleware(request: NextRequest) { // For /manage and /editor routes, allow direct access (authentication disabled) if (request.nextUrl.pathname.startsWith('/manage') || request.nextUrl.pathname.startsWith('/editor')) { // Allow direct access without authentication return NextResponse.next(); } // For all other routes, continue with normal processing return NextResponse.next(); } export const config = { matcher: [ /* * Match all request paths except for the ones starting with: * - api/email (email API routes) * - api/health (health check) * - _next/static (static files) * - _next/image (image optimization files) * - favicon.ico (favicon file) * - api/auth (auth API routes - need to be processed) */ '/((?!api/email|api/health|_next/static|_next/image|favicon.ico|api/auth).*)', ], };