From 5e9bb54af9ecf4ffa4f1cc6b2729c51f2f5ca007 Mon Sep 17 00:00:00 2001 From: IM23a-cernik Date: Thu, 17 Apr 2025 15:30:05 +0200 Subject: [PATCH] automatically adds the creator to the lobby --- lobby.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lobby.js b/lobby.js index a0464c6..971accf 100644 --- a/lobby.js +++ b/lobby.js @@ -22,12 +22,12 @@ async function joinLobby(lobbyId, player_name) { app.get("/lobby/create", async (req, res) => { let lobbyId = await createLobby(); - res.send(lobbyId); + res.send(lobbyId).redirect("/lobby/join"); }) app.get("/lobby/join", async (req, res) => { let lobbyId = req.query.lobbyId; - let name = req.query.name; + let name = req.body.username; const users = get_data(); const user = (users.find(u => u.username === name))