Skip to content

Navbar passes hardcoded userId="user-1" to NavRankBadge and CreditBalance #272

Description

@Benjtalkshow

components/global-navbar.tsx:143-144 and components/ui/global-resizable-navbar.tsx:40 both pass userId="user-1" to <NavRankBadge> and <CreditBalance>. Every authenticated user sees user-1's rank and credit balance in the navbar regardless of who they're signed in as.

A {/* TODO: Replace with actual auth user ID */} comment is already there acknowledging the placeholder.

What to do

In both files:

  • Read the session via authClient.useSession() (already imported in global-navbar.tsx, needs adding in global-resizable-navbar.tsx)
  • Pull userId = session?.user?.id
  • Pass that to both NavRankBadge and CreditBalance. When undefined, the components already render their own empty state.

Remove the TODO comment once wired.

Acceptance criteria

  • Signed-in users see their own rank badge and credit balance in the navbar
  • Signed-out users see whatever empty state NavRankBadge and CreditBalance already render for undefined userId
  • No grep hit for "user-1" in either navbar file
  • TODO comment removed

Files

  • components/global-navbar.tsx
  • components/ui/global-resizable-navbar.tsx

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions