From 47e228113042bc46c5f35363bcbbf9ff679f2f84 Mon Sep 17 00:00:00 2001 From: IM23a-spirgif Date: Tue, 6 May 2025 14:31:44 +0200 Subject: [PATCH] Fixed a small bug --- gambling.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gambling.js b/gambling.js index 24315db..15eb412 100644 --- a/gambling.js +++ b/gambling.js @@ -165,6 +165,11 @@ app.delete("/logout", authenticateToken, (request, response) => { const username = request.user.username; const users = get_data(); const user = users.find(u => u.username === username); + let lobbyId = request.lobbyId; + + if (playerMap[lobbyId].includes(username)) { + playerMap[lobbyId].splice(username, 1); + } // 1) Clear the HttpOnly cookie in the browser response.clearCookie("authorization", {