diff options
| author | Adam Soltys <[email protected]> | 2021-08-03 01:52:53 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2021-08-03 01:52:53 -0700 |
| commit | 1344458e0cf3322253599524899b3cce565cf1af (patch) | |
| tree | fd2eb66c71211f25f4e5e2ec209a78747a81e123 /lib/sockets.js | |
| parent | bca4fe152c83ab6a615a5e1601ca965187ee95e3 (diff) | |
| parent | e5e2bcf015b128c71cacf125d6aea4a0dddd30c3 (diff) | |
| download | coinos-server-1344458e0cf3322253599524899b3cce565cf1af.tar.gz coinos-server-1344458e0cf3322253599524899b3cce565cf1af.zip | |
Merge branch 'dev' into v1.0.0
Diffstat (limited to 'lib/sockets.js')
| -rw-r--r-- | lib/sockets.js | 2 |
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"); |
