Fixed cookie problems
This commit is contained in:
@@ -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());
|
||||||
|
|||||||
Reference in New Issue
Block a user