diff --git a/src/components/dashboard/DashboardLayout.tsx b/src/components/dashboard/DashboardLayout.tsx index 30cbee9..630525c 100644 --- a/src/components/dashboard/DashboardLayout.tsx +++ b/src/components/dashboard/DashboardLayout.tsx @@ -5,9 +5,20 @@ import { CalendarioAtendimentos } from './CalendarioAtendimentos'; import { BenchmarkingEscritorio } from './BenchmarkingEscritorio'; import { AtendimentosDia } from './AtendimentosDia'; +function isValidJWT(token?: string) { + return !!token && token.split('.').length === 3; +} + export const DashboardLayout: React.FC = () => { - const { user } = useAuth(); - // ...aqui você pode usar hooks customizados para buscar os dados necessários... + const { user, token } = useAuth(); + + if (!user || !isValidJWT(token)) { + return ( +