middleware error catch

This commit is contained in:
Julian Krauser 2025-02-25 18:35:02 +01:00
parent 1151ec45dc
commit 3da02a89a7

View file

@ -7,6 +7,7 @@ import { Socket } from "socket.io";
import { SocketMap } from "../../storage/socketMap";
export default async function authenticateSocket(socket: Socket, next: Function) {
try {
const token = socket.handshake.auth.token;
if (!token) {
@ -45,4 +46,7 @@ export default async function authenticateSocket(socket: Socket, next: Function)
socket.join("home");
next();
} catch (err) {
next(err);
}
}