Skip to content

Commit d4b9256

Browse files
authored
Merge pull request #301 from nanaabdul1172/Leaderboard
Leaderboard hardcodes currentUserId = user-1 instead of reading from session
2 parents 26972e5 + 23bdbe9 commit d4b9256

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

app/leaderboard/page.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import {
1111
import { LeaderboardTimeframe } from "@/lib/graphql/generated";
1212
import { useState, useEffect } from "react";
1313
import { useRouter, useSearchParams } from "next/navigation";
14+
import { authClient } from "@/lib/auth-client";
1415
import {
1516
TIMEFRAMES,
1617
TIERS,
@@ -45,9 +46,8 @@ export default function LeaderboardPage() {
4546
tags: initialTags || [],
4647
});
4748

48-
// Fake current user ID for demo purposes
49-
// In a real app this would come from auth context
50-
const currentUserId = "user-1";
49+
const { data: session } = authClient.useSession();
50+
const currentUserId = session?.user?.id;
5151

5252
// Debounce filters to prevent rapid API calls/URL updates
5353
const [debouncedFilters, setDebouncedFilters] =

0 commit comments

Comments
 (0)