Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IsEmail function not working #61

Closed
mohdsiddiquebagwan opened this issue Nov 13, 2013 · 2 comments
Closed

IsEmail function not working #61

mohdsiddiquebagwan opened this issue Nov 13, 2013 · 2 comments

Comments

@mohdsiddiquebagwan
Copy link

Hi,
In below statement
req.assert('siddique_bagwan@gmail.com', 'valid email is required').isEmail();

I have entered a correct e mail still isEmail giving error.

If I am wrong then please correct me.
Thanks
Mohd Siddique Bagwan.

@petecoop
Copy link
Contributor

req.assert() checks the req.param() for the input so in you example if you have a form submitting with an email field with the name of email you would use it like:

req.assert('email', 'valid email is required').isEmail()

For what you are doing you want to use https://github.com/chriso/node-validator, which this project is based on, and do:

check('siddique_bagwan@gmail.com').isEmail()

@lock
Copy link

lock bot commented Jun 2, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Jun 2, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants