Fix auth flows and add daemon heartbeat endpoint
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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">
|
||||
|
||||
Reference in New Issue
Block a user