diff options
author | Akshay" (aider) <[email protected]> | 2024-11-09 09:50:13 +0000 |
---|---|---|
committer | Akshay" (aider) <[email protected]> | 2024-11-09 09:50:13 +0000 |
commit | 02dcf1c1ab34c803eb8f3c66048fcd1d101774ae (patch) | |
tree | 604e9976991132b9695c19ad8ea4aefbb4244312 /src/routes/index.js | |
parent | 7a727510109c1062ac9009df88db992791ee1ce8 (diff) |
fix: Add URL-encoded middleware and request body logging for /register endpoint
Diffstat (limited to 'src/routes/index.js')
-rw-r--r-- | src/routes/index.js | 4 |
1 files changed, 4 insertions, 0 deletions
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) => { | |||
78 | 78 | ||
79 | router.post("/register", async (req, res) => { | 79 | router.post("/register", async (req, res) => { |
80 | const { username, password, confirm_password } = req.body; | 80 | const { username, password, confirm_password } = req.body; |
81 | console.log("Request body:", req.body); | ||
82 | if (!username || !password || !confirm_password) { | ||
83 | return res.status(400).send("All fields are required"); | ||
84 | } | ||
81 | if (password !== confirm_password) { | 85 | if (password !== confirm_password) { |
82 | return res.status(400).send("Passwords do not match"); | 86 | return res.status(400).send("Passwords do not match"); |
83 | } | 87 | } |