From 72f0b23041dcc0040529f3b6ece1852c828d7bdd Mon Sep 17 00:00:00 2001 From: "Builder.io" Date: Sun, 16 Nov 2025 08:41:20 +0000 Subject: [PATCH] completionId: cgen-8b52cb96c706478998f4933a5e9c328d cgen-8b52cb96c706478998f4933a5e9c328d --- client/pages/Login.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/client/pages/Login.tsx b/client/pages/Login.tsx index 8aae9a70..69a72150 100644 --- a/client/pages/Login.tsx +++ b/client/pages/Login.tsx @@ -134,10 +134,14 @@ export default function Login() { // Check if there's an OAuth redirect destination stored (e.g., from staff login) const oauthRedirect = sessionStorage.getItem("oauth_redirect_to"); + + // New logic: if profile exists (even if incomplete), go to Dashboard + // Otherwise send to Onboarding for new users + const profileExists = profile !== null; const redirectDest = (next && next.startsWith("/") ? next : null) || oauthRedirect || - (profileComplete ? "/dashboard" : "/onboarding"); + (profileExists ? "/dashboard" : "/onboarding"); // Clear the stored redirect after using it if (oauthRedirect) { @@ -148,7 +152,7 @@ export default function Login() { replace: true, }); } - }, [user, loading, profileComplete, navigate, location.search]); + }, [user, profile, loading, navigate, location.search]); // Pre-fill email if Discord was just linked useEffect(() => {