Uecko_ERP/apps/web/src/routes/public-only-guard.tsx

19 lines
466 B
TypeScript
Raw Normal View History

2026-06-02 16:40:23 +00:00
// apps/web/src/routes/guards/public-only-route.tsx
import type { ReactNode } from "react";
import { Navigate } from "react-router-dom";
interface PublicOnlyRouteProps {
children: ReactNode;
}
export const PublicOnlyRouteGuard = ({ children }: PublicOnlyRouteProps) => {
// TODO: sustituir por tu estado real de auth.
const isAuthenticated = false;
if (isAuthenticated) {
return <Navigate replace to="/proformas" />;
}
return <>{children}</>;
};