Fix authentication check to prevent loading screen getting stuck
cgen-2b7c09dad5b5420383a06b146d7efa2d
This commit is contained in:
parent
d882260575
commit
18e3c2edc2
1 changed files with 7 additions and 2 deletions
|
|
@ -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",
|
||||
|
|
|
|||
Loading…
Reference in a new issue