diff --git a/app.js b/app.js index 99c3c8d..0b2b097 100644 --- a/app.js +++ b/app.js @@ -68,7 +68,7 @@ app.post("/login", async (req, res) => { res.status(400).send("All input is required"); } // Validate if user exist in our database - const user = await User.findOne({ email }); + const user = await User.findOne({ email.toLowerCase() }); //ux: convert email input to lowerCase before check if (user && (await bcrypt.compare(password, user.password))) { // Create token