diff options
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 | } |