fix redir

This commit is contained in:
2025-10-28 11:34:25 -03:00
parent 45ea53b364
commit c2aa536660
2 changed files with 7 additions and 1 deletions
+1 -1
View File
@@ -25,7 +25,7 @@ const App = () => (
element={<Redirect />}
/>
<Route path="/*" element={GlobalFunctions.isUsuarioLogado() ? <Index /> : <HGTXLogin />} />
<Route path="/*" element={<Index />} />
{/* ADD ALL CUSTOM ROUTES ABOVE THE CATCH-ALL "*" ROUTE */}
<Route path="*" element={<NotFound />} />
<Route path="/404" element={<NotFound />} />
+6
View File
@@ -8,6 +8,8 @@ import { BotView } from "@/components/bots/BotView";
import { BotChat } from "@/components/bots/BotChat";
import { AgentView } from "@/components/agent/AgentView";
import { Navigate, Route, Routes } from "react-router-dom";
import React from "react";
import { GlobalFunctions } from "@/GlobalFunctions";
interface Bot {
id: string;
@@ -28,6 +30,10 @@ const Index = () => {
setActiveBotChat(null);
};
React.useEffect(() => {
if(!GlobalFunctions.isUsuarioLogado())window.location.replace(import.meta.env.VITE_BASE_URL_HGTX_CORE);
},[]);
return (<Routes>
<Route path="" element={<Navigate to={`/404`} replace />} />
<Route path="codex">