refactor: redesign planos interface with design system patterns
- Create CreatePlanModal component with Headless UI Dialog - Implement dark mode support throughout plans UI - Update plans/page.tsx with professional card layout - Update plans/[id]/page.tsx with consistent styling - Add proper spacing, typography, and color consistency - Implement smooth animations and transitions - Add success/error message feedback - Improve form UX with better input styling
This commit is contained in:
@@ -7,11 +7,16 @@ export async function middleware(request: NextRequest) {
|
||||
|
||||
const apiBase = process.env.API_INTERNAL_URL || 'http://backend:8080';
|
||||
|
||||
// Extrair subdomínio
|
||||
const subdomain = hostname.split('.')[0];
|
||||
// Extrair subdomínio (remover porta se houver)
|
||||
const hostnameWithoutPort = hostname.split(':')[0];
|
||||
const subdomain = hostnameWithoutPort.split('.')[0];
|
||||
|
||||
// Validar subdomínio de agência ({subdomain}.localhost)
|
||||
if (hostname.includes('.')) {
|
||||
// Rotas públicas que não precisam de validação de tenant
|
||||
const publicPaths = ['/login', '/cadastro', '/'];
|
||||
const isPublicPath = publicPaths.some(path => url.pathname === path || url.pathname.startsWith(path + '/'));
|
||||
|
||||
// Validar subdomínio de agência ({subdomain}.localhost) apenas se não for rota pública
|
||||
if (hostname.includes('.') && !isPublicPath) {
|
||||
try {
|
||||
const res = await fetch(`${apiBase}/api/tenant/check?subdomain=${subdomain}`, {
|
||||
cache: 'no-store',
|
||||
|
||||
Reference in New Issue
Block a user