mirror of
https://github.com/steveiliop56/tinyauth.git
synced 2026-05-21 19:50:14 +00:00
13 lines
289 B
TypeScript
13 lines
289 B
TypeScript
import { Navigate } from "react-router";
|
|
import { useUserContext } from "./context/user-context";
|
|
|
|
export const App = () => {
|
|
const { auth } = useUserContext();
|
|
|
|
if (auth.authenticated) {
|
|
return <Navigate to="/logout" replace />;
|
|
}
|
|
|
|
return <Navigate to="/login" replace />;
|
|
};
|