aboutsummaryrefslogtreecommitdiffstats
path: root/lib/sockets.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sockets.js')
-rw-r--r--lib/sockets.js3
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/sockets.js b/lib/sockets.js
index b6a806ff..931a9d23 100644
--- a/lib/sockets.js
+++ b/lib/sockets.js
@@ -92,10 +92,9 @@ wss.on("connection", function(ws, req) {
case "login":
let token = data;
- if (differenceInSeconds(new Date(), subSeconds(lastSeen[token], 5)) < 2) return;
+ if (differenceInSeconds(new Date(), lastSeen[token]) < 5) return;
lastSeen[token] = new Date();
-
try {
if (!token || token === "null") return ws.close();
const username = jwt.decode(token).username;