Files
SnowLuma/packages/webui/src/lib/api/session-headers.ts
T
DrSmoothl 5150d83403 fix(webui): preserve reverse proxy authentication
Prevent login loops when the WebUI is protected by HTTP authentication
at a reverse proxy. Apply the fix to settings, uploads, and live streams
while retaining compatibility with existing WebUI clients.

Fixes #523
2026-10-14 08:13:50 +08:00

13 lines
371 B
TypeScript

export const WEBUI_SESSION_HEADER = 'X-SnowLuma-Token';
/** Leave Authorization available for HTTP authentication at the reverse proxy. */
export function webuiSessionHeaders(token: string | null, initial?: HeadersInit): Headers {
const headers = new Headers(initial);
if (token) {
headers.set(WEBUI_SESSION_HEADER, token);
}
return headers;
}