aboutsummaryrefslogtreecommitdiffstats
path: root/lib/sockets.js
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2021-08-03 01:52:33 -0700
committerAdam Soltys <[email protected]>2021-08-03 01:52:33 -0700
commite5e2bcf015b128c71cacf125d6aea4a0dddd30c3 (patch)
tree09af4085f72fa2466cb0f66768be6e882be30f81 /lib/sockets.js
parent2f52a91c5babde9e374dd9c532448f565bcbfeee (diff)
parent1fbae57bb9540b1c116efc367809ac01ae2e9df2 (diff)
downloadcoinos-server-e5e2bcf015b128c71cacf125d6aea4a0dddd30c3.tar.gz
coinos-server-e5e2bcf015b128c71cacf125d6aea4a0dddd30c3.zip
Merge branch 'prod' into dev
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");