I was working with express-validator
when i encountered that i used normalize email for validation of email while signing up so i stored the normalized email to server.
Validation code:
router.post(
"/signup",
[
check("name").not().isEmpty(),
check("email").normalizeEmail().isEmail(),
check("password").isLength({ min: 6, max: 15 }),
],
userController.signupUser
);
Input email: abc.123@mail.com
normalized email: abc123@gmail.com
(storing in db)
Now the problem is when working on login the input email doesn't matches and shows invalid credentials.