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