feat: Add JWT authentication to backend, configure frontend API client, fix streak layout

This commit is contained in:
2026-09-23 12:11:44 +05:30
parent ea03846b9c
commit a3e430cb67
27 changed files with 210 additions and 120 deletions

View File

@@ -1,3 +1,4 @@
import { fetchWithAuth } from "@/lib/apiClient";
import { create } from 'zustand'
import { persist, StateStorage, createJSONStorage } from 'zustand/middleware'
import { get, set, del } from 'idb-keyval'
@@ -252,7 +253,7 @@ export const useCBTStore = create<CBTState>()(
if (!payload) return null;
try {
const res = await fetch(`/api/attempts/submit`, {
const res = await fetchWithAuth(`/api/attempts/submit`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(payload),