the error part pageReferenceError: res is not defined
I am just rendering the dashboard page after successfull login but even though credentials are correct , i am still not able to see dashboard page . Here my server.js file code! app.post("/login",async(req,res)=>{ try{ const email = req.body.fromemail; const password = req.body.password; const useremail = await User.findOne({email:email}); const isMatch = await bcrypt.compare(password,useremail.password); console.log(isMatch); const token = await useremail.generateAuthToken(); console.log("the token part"+token); if (isMatch){ res.status(201).render("dash"); } else{ res.send("invalid login details"); } // res.send(userstatus.password) // console.log(userstatus.password); // // console.log(email+" and "+password); // res.render("dash"); }catch(err){ console.log("the error part page"+err); res.status(400).send("invalid"); } // res.render("dash"); })