fix: redirigir automaticamente /dashboard a app.repairit.cloud/dashboard

This commit is contained in:
Edgar Javier Ortiz 2026-08-19 18:37:44 -03:00
parent 98c99d68be
commit 50a76b534e

View File

@ -33,10 +33,20 @@ export default function App() {
const hostname = window.location.hostname; const hostname = window.location.hostname;
const pathname = window.location.pathname; const pathname = window.location.pathname;
if (hostname === "app.repairit.cloud" && pathname === "/") { if (hostname.includes("repairit.cloud")) {
window.location.href = "/dashboard"; // Si está en el dashboard pero no en app.repairit.cloud, redirigir a app.repairit.cloud/dashboard
} else if (hostname === "tracking.repairit.cloud" && pathname === "/") { if (hostname !== "app.repairit.cloud" && pathname.startsWith("/dashboard")) {
window.location.href = "/seguimiento/demo-id"; window.location.href = `https://app.repairit.cloud${pathname}`;
return;
}
if (hostname === "app.repairit.cloud" && pathname === "/") {
window.location.href = "/dashboard";
return;
}
if (hostname === "tracking.repairit.cloud" && pathname === "/") {
window.location.href = "/seguimiento/demo-id";
return;
}
} }
const { data: { subscription } } = supabase.auth.onAuthStateChange(async (event, session) => { const { data: { subscription } } = supabase.auth.onAuthStateChange(async (event, session) => {