From fb01eb522806442ba12fb35ec780de4ee54589a7 Mon Sep 17 00:00:00 2001 From: Sam Catlow Date: Tue, 27 Oct 2026 00:15:49 +1100 Subject: [PATCH] fix(dashboard-v2): gate session on status user, add favicon --- dashboard-v2/index.html | 4 ++++ dashboard-v2/src/lib/api.ts | 5 ++++- dashboard-v2/src/session.tsx | 6 +++++- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/dashboard-v2/index.html b/dashboard-v2/index.html index e70f60f6c..dc85adc7f 100644 --- a/dashboard-v2/index.html +++ b/dashboard-v2/index.html @@ -3,6 +3,10 @@ + Status | Archie diff --git a/dashboard-v2/src/lib/api.ts b/dashboard-v2/src/lib/api.ts index c522e9f5f..45840e9ab 100644 --- a/dashboard-v2/src/lib/api.ts +++ b/dashboard-v2/src/lib/api.ts @@ -90,7 +90,10 @@ export interface ComponentVersion { } export const api = { - authStatus: () => request<{ setup_required?: boolean }>("/api/auth/status"), + authStatus: () => + request<{ setup_required?: boolean; user?: unknown }>( + "/api/auth/status", + ), services: () => request("/api/services"), version: () => request<{ components: ComponentVersion[] }>("/api/version"), signIn: (email: string, password: string) => diff --git a/dashboard-v2/src/session.tsx b/dashboard-v2/src/session.tsx index d7a2d61b9..d918537be 100644 --- a/dashboard-v2/src/session.tsx +++ b/dashboard-v2/src/session.tsx @@ -27,7 +27,11 @@ export function SessionProvider({ children }: { children: ReactNode }) { api .authStatus() .then((status) => { - if (live) setState(status.setup_required ? "setup" : "authed"); + // The status is 200 for anonymous visitors too, with a null user. + if (live) + setState( + status.setup_required ? "setup" : status.user ? "authed" : "guest", + ); }) .catch(() => { // Any failure to prove a session means no session: the login page