fix: fix auth provider caching

This commit is contained in:
Abhishek Kumar 2026-06-18 17:34:48 +05:30
parent 2939726b2c
commit d60065bf0a
3 changed files with 22 additions and 7 deletions

View file

@ -49,11 +49,14 @@ async function resolveAuthConfig(): Promise<ResolvedAuthConfig> {
return cachedConfig;
}
} catch {
// Backend not reachable — fall back to local
// Backend not reachable — fall through without caching so we retry next request.
}
cachedConfig = { authProvider: "local", stackConfig: null };
return cachedConfig;
// Unknown (backend unreachable). Return the local fallback for THIS request but
// do NOT cache it: caching here would pin the entire UI to local auth until a
// container restart if the first resolution loses the startup race with the api
// service. Leaving it uncached means the next request retries and self-heals.
return { authProvider: "local", stackConfig: null };
}
/**