Fix authentication check to prevent loading screen getting stuck

cgen-2b7c09dad5b5420383a06b146d7efa2d
This commit is contained in:
Builder.io 2025-08-08 10:16:37 +00:00
parent d882260575
commit 18e3c2edc2

View file

@ -131,8 +131,8 @@ export default function Dashboard() {
}
};
// Return early if not authenticated
if (authLoading || !user || !profile) {
// Return early if auth is still loading
if (authLoading) {
return (
<LoadingScreen
message="Loading your dashboard..."
@ -142,6 +142,11 @@ export default function Dashboard() {
);
}
// If auth is complete but no user, the useEffect will handle redirect
if (!user || !profile) {
return null;
}
const statsDisplay = [
{
label: "Active Projects",