diff options
Diffstat (limited to 'frontend/app/components/ProtectedRoute.tsx')
| -rw-r--r-- | frontend/app/components/ProtectedRoute.tsx | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/frontend/app/components/ProtectedRoute.tsx b/frontend/app/components/ProtectedRoute.tsx index b943696..5f564a0 100644 --- a/frontend/app/components/ProtectedRoute.tsx +++ b/frontend/app/components/ProtectedRoute.tsx @@ -2,19 +2,19 @@ import { Redirect } from "wouter"; import { useAuth } from "../hooks/useAuth"; export default function ProtectedRoute({ - children, + children, }: { - children: React.ReactNode; + children: React.ReactNode; }) { - const { isLoggedIn, isLoading } = useAuth(); + const { isLoggedIn, isLoading } = useAuth(); - if (isLoading) { - return null; - } + if (isLoading) { + return null; + } - if (!isLoggedIn) { - return <Redirect to="/login" />; - } + if (!isLoggedIn) { + return <Redirect to="/login" />; + } - return <>{children}</>; + return <>{children}</>; } |
