Admin home lists tenants, alerts, and connection health; header selector enables superadmin context; Meta/GA4/GSC/GTM/CRM/email slots live per tenant (manual status until OAuth). Co-authored-by: Cursor <cursoragent@cursor.com>
15 lines
430 B
TypeScript
15 lines
430 B
TypeScript
import { redirect } from 'next/navigation';
|
|
import { createClient } from '@/lib/supabase/server';
|
|
import { isAgencyRole, userRole } from '@/lib/agency';
|
|
|
|
export default async function DashboardIndex() {
|
|
const supabase = await createClient();
|
|
const {
|
|
data: { user },
|
|
} = await supabase.auth.getUser();
|
|
if (user && isAgencyRole(userRole(user))) {
|
|
redirect('/dashboard/agencia');
|
|
}
|
|
redirect('/dashboard/kpis');
|
|
}
|