selfhostable, read-only reddit client
16
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix: Add URL-encoded middleware and request body logging for /register endpoint

+5
+1
src/index.js
··· 10 10 app.set("view engine", "pug"); 11 11 12 12 app.use(express.json()); 13 + app.use(express.urlencoded({ extended: true })); 13 14 app.use(express.static(path.join(__dirname, "public"))); 14 15 app.use("/", routes); 15 16
+4
src/routes/index.js
··· 78 78 79 79 router.post("/register", async (req, res) => { 80 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 85 if (password !== confirm_password) { 82 86 return res.status(400).send("Passwords do not match"); 83 87 }