From 8f704693172663a43e98b2477ee169949af9481e Mon Sep 17 00:00:00 2001 From: Tiago Yamamoto Date: Mon, 22 Dec 2025 13:25:40 -0300 Subject: [PATCH] Unify dashboard routing for all roles --- frontend/src/app/login/page.tsx | 9 +-------- frontend/src/components/dashboard-header.tsx | 6 +----- frontend/src/components/navbar.tsx | 7 ++----- 3 files changed, 4 insertions(+), 18 deletions(-) diff --git a/frontend/src/app/login/page.tsx b/frontend/src/app/login/page.tsx index 8c92ea5..16b348f 100644 --- a/frontend/src/app/login/page.tsx +++ b/frontend/src/app/login/page.tsx @@ -69,14 +69,7 @@ export default function LoginPage() { localStorage.setItem("rememberedEmail", data.email); } - // Redirect based on role - if (user.role === "admin" || user.roles?.includes("admin")) { - router.push("/dashboard/admin"); - } else if (user.role === "company" || user.roles?.includes("company")) { - router.push("/dashboard/empresa"); - } else { - router.push("/dashboard/candidato"); - } + router.push("/dashboard"); } else { setError("Usuário ou senha inválidos."); } diff --git a/frontend/src/components/dashboard-header.tsx b/frontend/src/components/dashboard-header.tsx index 47fde1c..e30d676 100644 --- a/frontend/src/components/dashboard-header.tsx +++ b/frontend/src/components/dashboard-header.tsx @@ -27,11 +27,7 @@ export function DashboardHeader() { }; const handleProfileClick = () => { - if (user?.role === "admin") { - router.push("/dashboard/admin/profile"); - } else { - router.push("/dashboard/candidato/perfil"); - } + router.push("/profile"); }; const getInitials = (name: string) => { diff --git a/frontend/src/components/navbar.tsx b/frontend/src/components/navbar.tsx index f926c10..7be2573 100644 --- a/frontend/src/components/navbar.tsx +++ b/frontend/src/components/navbar.tsx @@ -49,7 +49,7 @@ export function Navbar() {
{user ? ( - +