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 (