From fb9190f1628d055cf3a5e8815fc7e67f438d0506 Mon Sep 17 00:00:00 2001 From: "Builder.io" Date: Mon, 10 Nov 2025 01:23:09 +0000 Subject: [PATCH] Remove problematic onboarding redirect from Dashboard - user should never be auto-redirected cgen-d112e0e72d964c4cb4adb47e88d90e62 --- client/pages/Dashboard.tsx | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/client/pages/Dashboard.tsx b/client/pages/Dashboard.tsx index 7a2ef591..a40da365 100644 --- a/client/pages/Dashboard.tsx +++ b/client/pages/Dashboard.tsx @@ -287,28 +287,28 @@ export default function Dashboard() { authLoading, }); - // Only redirect to login when auth is resolved and there's no user - if (!user && !authLoading) { - console.log("No user after auth resolved, redirecting to onboarding"); - setIsLoading(false); - navigate("/onboarding", { replace: true }); - return; - } - // While auth is still resolving, keep showing loading state - if (!user && authLoading) { + if (authLoading) { setIsLoading(true); return; } + // Auth resolved - check user state + if (!user) { + console.log("No user, showing login prompt (not redirecting)"); + setIsLoading(false); + return; + } + + // User exists - load dashboard data if (user && profile) { console.log("User and profile exist, loading dashboard data"); loadDashboardData(); - } else if (user && !profile && !authLoading) { - console.log("User exists but no profile, clearing loading"); + } else if (user && !profile) { + console.log("User exists but no profile, showing message (not redirecting)"); setIsLoading(false); } - }, [user, profile, authLoading, navigate]); + }, [user, profile, authLoading]); // Sync local settings form with profile useEffect(() => {