fix: asegurar que el inicio de sesion y almacenamiento local ocurra 100% en app.repairit.cloud
This commit is contained in:
parent
887f7aa43f
commit
91888ed15a
|
|
@ -35,10 +35,13 @@ export default function App() {
|
|||
|
||||
if (hostname.includes("repairit.cloud")) {
|
||||
const token = localStorage.getItem("repairit_token");
|
||||
// Si está en el dashboard pero no en app.repairit.cloud, redirigir a app.repairit.cloud/dashboard
|
||||
if (hostname !== "app.repairit.cloud" && pathname === "/login") {
|
||||
window.location.href = "https://app.repairit.cloud/login";
|
||||
return;
|
||||
}
|
||||
if (hostname !== "app.repairit.cloud" && pathname.startsWith("/dashboard")) {
|
||||
if (!token) {
|
||||
window.location.href = "https://repairit.cloud/login";
|
||||
window.location.href = "https://app.repairit.cloud/login";
|
||||
return;
|
||||
}
|
||||
window.location.href = `https://app.repairit.cloud${pathname}`;
|
||||
|
|
@ -46,7 +49,7 @@ export default function App() {
|
|||
}
|
||||
if (hostname === "app.repairit.cloud" && pathname === "/") {
|
||||
if (!token) {
|
||||
window.location.href = "https://repairit.cloud/login";
|
||||
window.location.href = "https://app.repairit.cloud/login";
|
||||
return;
|
||||
}
|
||||
window.location.href = "/dashboard";
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ export default function PublicLayout() {
|
|||
</a>
|
||||
<Separator orientation="vertical" className="hidden md:block h-4 !self-center" />
|
||||
<Button asChild variant="outline" size="sm" className="text-primary border-primary/20 hover:border-primary/40 bg-primary/10 hover:bg-primary/20 font-bold transition-all duration-200">
|
||||
<a href={window.location.hostname.includes("repairit.cloud") ? "https://app.repairit.cloud/dashboard" : "/login"}>
|
||||
<a href={window.location.hostname.includes("repairit.cloud") ? "https://app.repairit.cloud/login" : "/login"}>
|
||||
Panel Técnico
|
||||
</a>
|
||||
</Button>
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user