feat: integrate Convex authentication across ticket management routes

- Added useConvexWithAuth hook to ensure authenticated access for ticket-related pages.
- Updated the perfil and central-chamados routes to include the authentication setup.
- Enhanced user navigation by adding a new "Meus Chamados" tab in the perfil page for better access to ticket management.
This commit is contained in:
2025-11-16 14:19:01 -03:00
parent 118051ad56
commit 24b8eb6a14
4 changed files with 38 additions and 0 deletions

View File

@@ -10,6 +10,7 @@
getStatusLabel,
prazoRestante,
} from "$lib/utils/chamados";
import { useConvexWithAuth } from "$lib/hooks/useConvexWithAuth";
type Ticket = Doc<"tickets">;
type Usuario = Doc<"usuarios">;
@@ -60,6 +61,8 @@
});
onMount(() => {
// Configura token no cliente Convex
useConvexWithAuth();
if (slaConfigsQuery?.data && slaConfigsQuery.data.length > 0) {
selecionarSla(slaConfigsQuery.data[0]);
}