Authentication updates

This commit is contained in:
Jack Mechem 2026-03-28 16:01:45 -07:00
parent 98b1daa7d3
commit 3015c98246
15 changed files with 657 additions and 165 deletions

View file

@ -50,6 +50,11 @@ export interface Stats {
export async function getStats(): Promise<Stats> {
const res = await fetch("/api/stats");
if (res.status === 401) {
throw new Error("UNAUTHORIZED");
}
if (!res.ok) throw new Error(`Failed to fetch stats: ${res.status}`);
return res.json() as Promise<Stats>;
}