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) {