From 02dcf1c1ab34c803eb8f3c66048fcd1d101774ae Mon Sep 17 00:00:00 2001 From: "Akshay\" (aider)" Date: Sat, 9 Nov 2024 09:50:13 +0000 Subject: fix: Add URL-encoded middleware and request body logging for /register endpoint --- src/routes/index.js | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/routes/index.js') diff --git a/src/routes/index.js b/src/routes/index.js index 6153692..2ee97e3 100644 --- a/src/routes/index.js +++ b/src/routes/index.js @@ -78,6 +78,10 @@ router.get("/register", async (req, res) => { router.post("/register", async (req, res) => { const { username, password, confirm_password } = req.body; + console.log("Request body:", req.body); + if (!username || !password || !confirm_password) { + return res.status(400).send("All fields are required"); + } if (password !== confirm_password) { return res.status(400).send("Passwords do not match"); } -- cgit v1.2.3