diff --git a/src/components/portal/portal-shell.tsx b/src/components/portal/portal-shell.tsx index 3bd2278..79c60ee 100644 --- a/src/components/portal/portal-shell.tsx +++ b/src/components/portal/portal-shell.tsx @@ -42,19 +42,13 @@ export function PortalShell({ children }: PortalShellProps) { const handleTokenRevoked = useCallback(() => { console.log("[PortalShell] Token foi revogado - redirecionando para tela de registro") - toast.error("Este dispositivo foi resetado. Faça login novamente.") - // Se estiver rodando dentro do Tauri, navega para a URL do app para voltar à tela de registro - const isTauri = typeof window !== "undefined" && Boolean((window as typeof window & { __TAURI__?: unknown }).__TAURI__) - if (isTauri) { - // URL do app Tauri - em producao usa tauri.localhost, em dev usa localhost:1420 - const isDev = process.env.NODE_ENV === "development" - const tauriUrl = isDev ? "http://localhost:1420/" : "http://tauri.localhost/" - console.log("[PortalShell] Detectado ambiente Tauri, navegando para:", tauriUrl) - window.location.href = tauriUrl - return - } - router.replace("/login") - }, [router]) + toast.error("Este dispositivo foi resetado. Reprovisione para continuar.") + // Sessão "machine" existe apenas no fluxo do desktop; ao revogar o token, voltamos ao onboarding do app. + const isDev = process.env.NODE_ENV === "development" + const tauriUrl = isDev ? "http://localhost:1420/" : "http://tauri.localhost/" + console.log("[PortalShell] Redirecionando para o onboarding do desktop:", tauriUrl) + window.location.href = tauriUrl + }, []) const { isActive: machineIsActive } = useMachineStateMonitor({ machineId: machineContext?.machineId,