mirror of
https://github.com/steveiliop56/tinyauth.git
synced 2025-10-28 20:55:42 +00:00
* wip * refactor: update domain warning layout * i18n: add domain warning translations * refactor: rework hooks usage * feat: clear timeouts * fix: use useeffect to cleanup timeout * refactor: rework redirects and history storage * refactor: rename domain to root domain
13 lines
287 B
TypeScript
13 lines
287 B
TypeScript
import { Navigate } from "react-router";
|
|
import { useUserContext } from "./context/user-context";
|
|
|
|
export const App = () => {
|
|
const { isLoggedIn } = useUserContext();
|
|
|
|
if (isLoggedIn) {
|
|
return <Navigate to="/logout" replace />;
|
|
}
|
|
|
|
return <Navigate to="/login" replace />;
|
|
};
|