initial commit, boilerplate stuff
This commit is contained in:
11
src/pages/RestrictedLoggedIn.tsx
Normal file
11
src/pages/RestrictedLoggedIn.tsx
Normal file
@@ -0,0 +1,11 @@
|
||||
import { Navigate } from "react-router";
|
||||
|
||||
import { useAuth } from "../hooks/useAuth.ts";
|
||||
|
||||
export function RestrictedLoggedIn(
|
||||
{ children }: { children: React.ReactNode },
|
||||
) {
|
||||
const { user } = useAuth();
|
||||
|
||||
return user ? <>{children}</> : <Navigate to="/login" />;
|
||||
}
|
||||
Reference in New Issue
Block a user