feat: Add JWT authentication to backend, configure frontend API client, fix streak layout
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
"use client"
|
||||
|
||||
import { fetchWithAuth } from "@/lib/apiClient";
|
||||
import { useRef, useState, useEffect } from "react"
|
||||
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card"
|
||||
import { Badge } from "@/components/ui/badge"
|
||||
@@ -26,7 +27,7 @@ export default function DashboardPage() {
|
||||
}
|
||||
async function fetchStats() {
|
||||
try {
|
||||
const res = await fetch(`/api/users/${currentUserId}/stats`)
|
||||
const res = await fetchWithAuth(`/api/users/${currentUserId}/stats`)
|
||||
if (res.ok) {
|
||||
const data = await res.json()
|
||||
setUserStats(data)
|
||||
|
||||
Reference in New Issue
Block a user