diff --git a/src/routes/admin/verification/[id].tsx b/src/routes/admin/verification/[id].tsx index bdd66c3..3b6f7af 100644 --- a/src/routes/admin/verification/[id].tsx +++ b/src/routes/admin/verification/[id].tsx @@ -3,10 +3,17 @@ import { For, Show, createMemo, createSignal, onMount } from 'solid-js'; const API = ''; async function adminFetch(path: string, opts?: RequestInit) { + const accessToken = typeof sessionStorage !== 'undefined' + ? sessionStorage.getItem('nxtgauge_admin_access_token') || '' + : ''; return fetch(`${API}${path}`, { ...opts, credentials: 'include', - headers: { 'Content-Type': 'application/json', ...(opts?.headers ?? {}) }, + headers: { + 'Content-Type': 'application/json', + ...(accessToken ? { Authorization: `Bearer ${accessToken}` } : {}), + ...(opts?.headers ?? {}), + }, }); } diff --git a/src/routes/admin/verification/index.tsx b/src/routes/admin/verification/index.tsx index 3bb17bb..225f34c 100644 --- a/src/routes/admin/verification/index.tsx +++ b/src/routes/admin/verification/index.tsx @@ -157,8 +157,14 @@ export default function VerificationManagementPage() { const load = async () => { try { setError(''); + const accessToken = typeof sessionStorage !== 'undefined' + ? sessionStorage.getItem('nxtgauge_admin_access_token') || '' + : ''; const res = await fetch(`${API}/api/admin/verifications?page=1&limit=200`, { - headers: { Accept: 'application/json' }, + headers: { + Accept: 'application/json', + ...(accessToken ? { Authorization: `Bearer ${accessToken}` } : {}), + }, credentials: 'include', }); if (!res.ok) throw new Error(`Failed to load verification queue (${res.status})`);