Websocket and auth fixes

This commit is contained in:
2025-10-15 15:14:27 +02:00
parent 8b562a37b2
commit cf32a2b778
7 changed files with 54 additions and 41 deletions
+7 -7
View File
@@ -26,13 +26,6 @@ export default async function auth(
ws.onopen = () => {
console.log("Connected to WebSocket:", ip);
ws.send(
JSON.stringify({
version: "0.0.1",
auth_token: server_auth,
last_message: lastMessage || 0,
})
);
};
ws.onmessage = (m) => {
@@ -41,6 +34,13 @@ export default async function auth(
if (data.version) {
setServer({ channels: [], ...data });
ws.send(
JSON.stringify({
version: "0.0.1",
auth_token: server_auth,
last_message: lastMessage || 0,
})
);
return;
}