debug(ws): log admin debug WS auth failure details

This commit is contained in:
Mitchell R 2026-05-22 20:39:19 +02:00
parent 31ba05b703
commit 5198a681eb
No known key found for this signature in database

View file

@ -246,7 +246,13 @@ export class Plugin extends BSBService<InstanceType<typeof Config>, typeof Event
} }
} }
if (!authed) throw new Error("unauthorized"); if (!authed) throw new Error("unauthorized");
} catch { } catch (authErr) {
obs.log.warn("admin debug WS auth failed for kiosk {id}: {err} (cookie present: {hasCookie}, cookieName: {cn})", {
id: kioskId,
err: (authErr as Error).message,
hasCookie: cookieHeader.length > 0,
cn: cookieName,
});
socket.write("HTTP/1.1 401 Unauthorized\r\n\r\n"); socket.write("HTTP/1.1 401 Unauthorized\r\n\r\n");
socket.destroy(); socket.destroy();
return; return;