aboutsummaryrefslogtreecommitdiffhomepage
path: root/frontend/app/components/PublicOnlyRoute.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'frontend/app/components/PublicOnlyRoute.tsx')
-rw-r--r--frontend/app/components/PublicOnlyRoute.tsx6
1 files changed, 5 insertions, 1 deletions
diff --git a/frontend/app/components/PublicOnlyRoute.tsx b/frontend/app/components/PublicOnlyRoute.tsx
index 2527918..7b3ef9d 100644
--- a/frontend/app/components/PublicOnlyRoute.tsx
+++ b/frontend/app/components/PublicOnlyRoute.tsx
@@ -6,7 +6,11 @@ export default function PublicOnlyRoute({
}: {
children: React.ReactNode;
}) {
- const { isLoggedIn } = useAuth();
+ const { isLoggedIn, isLoading } = useAuth();
+
+ if (isLoading) {
+ return null;
+ }
if (isLoggedIn) {
return <Redirect to="/dashboard" />;