Skip to content

Fix: Dashboard shows hardcoded username "Anshi" and static stats instead of real logged-in user dataΒ #82

@Ananya-CM

Description

@Ananya-CM

πŸ› Bug Report

Area: Dashboard β€” User greeting and Stats section
Type: Bug β€” Hardcoded Static Data
Priority: High β€” every user sees wrong name


πŸ“Œ Description

The Dashboard page displays hardcoded data for
both the user greeting and the stats section.
Every user who logs in sees "Welcome back, Anshi πŸ‘‹"
and the same fake statistics, regardless of who
is actually logged in or what their real data is.


πŸ” Proof β€” Hardcoded Data in Source Code

In frontend/app/dashboard/page.tsx:

const user = {
  name: "Anshi",    // ← hardcoded name
  role: "admin",    // ← hardcoded role
};

And the stats section:

const stats = [
  { title: "Velocity",  value: "+18%", icon: TrendingUp },
  { title: "Deploys",   value: "24",   icon: Rocket },
  { title: "Incidents", value: "2",    icon: AlertTriangle },
];

These are completely static β€” no connection to
any real user session or actual project data.


❌ Current Behaviour

  • Every user sees "Welcome back, Anshi πŸ‘‹"
    regardless of their actual name
  • Stats show the same fake numbers for everyone
  • No connection to real Supabase auth session
  • Logged-in user's actual name is ignored

βœ… Expected Behaviour

  • Greeting should show the actual logged-in
    user's name from Supabase session:
    "Welcome back, [Real Name] πŸ‘‹"
  • Role should reflect real user role from
    the profiles table
  • Stats should either show real computed
    values OR show a clear placeholder state
    indicating data is not yet available

πŸ’‘ Proposed Fix

In frontend/app/dashboard/page.tsx:

  1. Replace hardcoded user object with real
    session data fetched from Supabase:
const [user, setUser] = useState({ 
  name: "User", role: "member" 
});

useEffect(() => {
  const getUser = async () => {
    const { data: { session } } = 
      await supabase.auth.getSession();
    if (session?.user) {
      const name = 
        session.user.user_metadata?.full_name 
        || session.user.email 
        || "User";
      setUser({ name, role: "member" });
    }
  };
  getUser();
}, []);
  1. Replace hardcoded stats values with
    placeholder state that clearly shows
    data is not yet integrated:
const stats = [
  { title: "Velocity",  value: "β€”", icon: TrendingUp },
  { title: "Deploys",   value: "β€”", icon: Rocket },
  { title: "Incidents", value: "β€”", icon: AlertTriangle },
];

πŸ“‚ File to Change

frontend/app/dashboard/page.tsx β€” only this file


πŸ–₯️ Steps to Reproduce

  1. Sign up with any name (e.g. "Test User")
  2. Log in at http://localhost:3000/login
  3. Navigate to http://localhost:3000/dashboard
  4. Observe greeting says "Welcome back, Anshi πŸ‘‹"
    instead of your actual name
  5. Observe same fake stats for every user

@Shriii19
I'd like to work on this issue.
Could you please assign it to me?

nsoc26

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions