Prepara versao dev 1.0

This commit is contained in:
Erik Silva
2025-12-08 21:47:38 -03:00
parent 512287698e
commit 190fde20c3
85 changed files with 7755 additions and 2317 deletions

View File

@@ -0,0 +1,33 @@
import { NextResponse } from 'next/server';
import type { NextRequest } from 'next/server';
export function middleware(request: NextRequest) {
const hostname = request.headers.get('host') || '';
const url = request.nextUrl;
// Extrair subdomínio
const subdomain = hostname.split('.')[0];
// Se for dash.localhost - rotas administrativas (SUPERADMIN)
if (subdomain === 'dash') {
// Permitir acesso a /superadmin, /cadastro, /login
return NextResponse.next();
}
// Se for agência ({subdomain}.localhost) - rotas de tenant
// Permitir /dashboard, /login, /clientes, etc.
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).*)',
],
};