Files
front-impresiones/src/components/routes/LoginRedirect.jsx
T
2026-01-11 20:36:14 -06:00

11 lines
307 B
React

import { Navigate } from 'react-router-dom';
import { useAuth } from '../../services/useAuth';
export const LoginRedirect = ({ children }) => {
const { loading, authenticated } = useAuth();
if (loading) return <p>Cargando...</p>;
return authenticated ? <Navigate to='/' /> : children;
};
//IO