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:
@@ -7,6 +7,7 @@
|
||||
import TicketTimeline from "$lib/components/chamados/TicketTimeline.svelte";
|
||||
import { chamadosStore } from "$lib/stores/chamados";
|
||||
import { resolve } from "$app/paths";
|
||||
import { useConvexWithAuth } from "$lib/hooks/useConvexWithAuth";
|
||||
|
||||
type Ticket = Doc<"tickets">;
|
||||
type SlaConfig = Doc<"slaConfigs">;
|
||||
@@ -45,6 +46,11 @@
|
||||
carregarSlaConfigs();
|
||||
});
|
||||
|
||||
$effect(() => {
|
||||
// Garante que o cliente Convex use o token do usuário logado
|
||||
useConvexWithAuth();
|
||||
});
|
||||
|
||||
async function carregarSlaConfigs() {
|
||||
try {
|
||||
carregandoSla = true;
|
||||
|
||||
Reference in New Issue
Block a user