From 8bd3b8d3b1c02c2ed732ca4fbd331da6e1752a9c Mon Sep 17 00:00:00 2001 From: Arunavo Ray Date: Thu, 28 Aug 2025 10:50:18 +0530 Subject: [PATCH] Added redirect to /login --- src/components/layout/MainLayout.tsx | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/components/layout/MainLayout.tsx b/src/components/layout/MainLayout.tsx index 776cd81..680beee 100644 --- a/src/components/layout/MainLayout.tsx +++ b/src/components/layout/MainLayout.tsx @@ -97,6 +97,15 @@ function AppWithProviders({ page: initialPage }: AppProps) { ); } + // Redirect to login if not authenticated + if (!authLoading && !user) { + // Use window.location for client-side redirect + if (typeof window !== 'undefined') { + window.location.href = '/login'; + } + return null; + } + return (