import { NextRequest, NextResponse } from "next/server"; export function middleware(request: NextRequest) { // Aplicar middleware apenas para rotas específicas que precisam de controle de acesso const protectedPaths = [ "/dashboard", "/gestao-usuarios", "/empresas", "/usuarios", "/relatorios", ]; const { pathname } = request.nextUrl; // Verificar se a rota atual precisa de proteção const isProtectedPath = protectedPaths.some((path) => pathname.startsWith(path) ); if (isProtectedPath) { // Aqui você pode adicionar lógica adicional de verificação // Por exemplo, verificar tokens, sessões, etc. // Por enquanto, apenas continue return NextResponse.next(); } return NextResponse.next(); } export const config = { matcher: [ /* * Match all request paths except for the ones starting with: * - api (API routes) * - _next/static (static files) * - _next/image (image optimization files) * - favicon.ico (favicon file) */ "/((?!api|_next/static|_next/image|favicon.ico).*)", ], };