aboutsummaryrefslogtreecommitdiffstats
path: root/lib/sockets.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sockets.js')
-rw-r--r--lib/sockets.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/sockets.js b/lib/sockets.js
index 931a9d23..bd59ee38 100644
--- a/lib/sockets.js
+++ b/lib/sockets.js
@@ -96,7 +96,7 @@ wss.on("connection", function(ws, req) {
lastSeen[token] = new Date();
try {
- if (!token || token === "null") return ws.close();
+ if (!token || token === "null" || !jwt.decode(token)) return ws.close();
const username = jwt.decode(token).username;
if (!username) throw new Error("Invalid JWT token");