feat: Add JWT authentication to backend, configure frontend API client, fix streak layout
This commit is contained in:
@@ -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),
|
||||
|
||||
Reference in New Issue
Block a user