Fixed a small bug

This commit is contained in:
IM23a-spirgif
2025-05-06 14:31:44 +02:00
parent 2c18ea1fa0
commit 47e2281130
+5
View File
@@ -165,6 +165,11 @@ app.delete("/logout", authenticateToken, (request, response) => {
const username = request.user.username; const username = request.user.username;
const users = get_data(); const users = get_data();
const user = users.find(u => u.username === username); 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 // 1) Clear the HttpOnly cookie in the browser
response.clearCookie("authorization", { response.clearCookie("authorization", {