fix: Invalid token to websocket server should not log an error

This commit is contained in:
Tom Moor
2023-11-28 20:08:13 -05:00
parent fdd774fca7
commit ed175c84ff

View File

@@ -117,7 +117,9 @@ export default function init(
socket.emit("authenticated", true);
void authenticated(io, socket);
} catch (err) {
Logger.error(`Authentication error socket ${socket.id}`, err);
Logger.debug("websockets", `Authentication error socket ${socket.id}`, {
error: err.message,
});
socket.emit("unauthorized", { message: err.message }, function () {
socket.disconnect();
});