Merge pull request #226 from FreeCodeCamp/email-validation
fix email validation issue #212
This commit is contained in:
@ -94,8 +94,10 @@ exports.getEmailSignup = function(req, res) {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
exports.postEmailSignup = function(req, res, next) {
|
exports.postEmailSignup = function(req, res, next) {
|
||||||
var errors = req.validationErrors();
|
|
||||||
|
|
||||||
|
req.assert('email', 'valid email required').isEmail();
|
||||||
|
var errors = req.validationErrors();
|
||||||
|
|
||||||
if (errors) {
|
if (errors) {
|
||||||
req.flash('errors', errors);
|
req.flash('errors', errors);
|
||||||
return res.redirect('/email-signup');
|
return res.redirect('/email-signup');
|
||||||
|
Reference in New Issue
Block a user