diff options
| -rw-r--r-- | lib/sockets.js | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/sockets.js b/lib/sockets.js index ab16e2fa..e1896b8f 100644 --- a/lib/sockets.js +++ b/lib/sockets.js @@ -86,8 +86,7 @@ wss.on("connection", function (ws, req) { case "login": let token = data; try { - if (!token || token === "null") - throw new Error("Unauthorized socket login"); + if (!token || token === "null") return ws.close(); const username = jwt.decode(token).username; if (!username) throw new Error("Invalid JWT token"); |
