Remove problematic onboarding redirect from Dashboard - user should never be auto-redirected
cgen-d112e0e72d964c4cb4adb47e88d90e62
This commit is contained in:
parent
fd03ad4829
commit
fb9190f162
1 changed files with 12 additions and 12 deletions
|
|
@ -287,28 +287,28 @@ export default function Dashboard() {
|
||||||
authLoading,
|
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
|
// While auth is still resolving, keep showing loading state
|
||||||
if (!user && authLoading) {
|
if (authLoading) {
|
||||||
setIsLoading(true);
|
setIsLoading(true);
|
||||||
return;
|
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) {
|
if (user && profile) {
|
||||||
console.log("User and profile exist, loading dashboard data");
|
console.log("User and profile exist, loading dashboard data");
|
||||||
loadDashboardData();
|
loadDashboardData();
|
||||||
} else if (user && !profile && !authLoading) {
|
} else if (user && !profile) {
|
||||||
console.log("User exists but no profile, clearing loading");
|
console.log("User exists but no profile, showing message (not redirecting)");
|
||||||
setIsLoading(false);
|
setIsLoading(false);
|
||||||
}
|
}
|
||||||
}, [user, profile, authLoading, navigate]);
|
}, [user, profile, authLoading]);
|
||||||
|
|
||||||
// Sync local settings form with profile
|
// Sync local settings form with profile
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue