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:
@@ -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]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user