Fix auth flows and add daemon heartbeat endpoint

This commit is contained in:
2026-02-22 09:41:17 +00:00
parent c926613ee0
commit d7d8fd5339
8 changed files with 115 additions and 11 deletions
+7 -1
View File
@@ -38,7 +38,13 @@ async function request<T>(path: string, options: RequestOptions = {}): Promise<T
const res = await fetch(url, { ...fetchOptions, headers });
if (res.status === 401) {
const shouldHandle401WithRefresh =
res.status === 401 &&
path !== '/auth/login' &&
path !== '/auth/register' &&
path !== '/auth/refresh';
if (shouldHandle401WithRefresh) {
// Try refresh
const refreshed = await refreshToken();
if (refreshed) {
+1 -1
View File
@@ -37,7 +37,7 @@ export function DashboardPage() {
const servers = serversData?.data ?? [];
const running = servers.filter((s) => s.status === 'running').length;
const totalNodes = nodesData?.meta.total ?? 0;
const totalNodes = nodesData?.meta?.total ?? nodesData?.data?.length ?? 0;
return (
<div className="space-y-6">