Fixed cookie problems

This commit is contained in:
2026-02-16 00:49:10 +01:00
parent c914edd025
commit b2ba4fbcc8
+3 -1
View File
@@ -23,7 +23,7 @@ export function UPGRADE(client: WebSocket, server: WebSocketServer) {
client.send(JSON.stringify({ ok: false, error: "Missing cookies" })); client.send(JSON.stringify({ ok: false, error: "Missing cookies" }));
client.close(); client.close();
return; return;
}; }
const supabase = await createClientCookie(new Map(Object.entries(cookies))); const supabase = await createClientCookie(new Map(Object.entries(cookies)));
const session = await getSession(supabase); const session = await getSession(supabase);
@@ -33,6 +33,8 @@ export function UPGRADE(client: WebSocket, server: WebSocketServer) {
return; return;
} }
client.send(JSON.stringify({ ok: true }));
client.on("message", async (raw) => { client.on("message", async (raw) => {
try { try {
const msg: ClientMessage = JSON.parse(raw.toString()); const msg: ClientMessage = JSON.parse(raw.toString());