fix(dashboard-v2): gate session on status user, add favicon

This commit is contained in:
sam committed 2026-10-27 00:15:49 +11:00
1 parent 46606077de
commit fb01eb5228
3 files changed
+13 -2

No files matched your search

+4
View File
@@ -3,6 +3,10 @@
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link
rel="icon"
href="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Crect width='16' height='16' rx='3' fill='%23111'/%3E%3C/svg%3E"
/>
<title>Status | Archie</title>
</head>
<body>
+4 -1
View File
@@ -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<Service[]>("/api/services"),
version: () => request<{ components: ComponentVersion[] }>("/api/version"),
signIn: (email: string, password: string) =>
+5 -1
View File
@@ -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