diff options
| author | nanalelfe <nargiza.nosirova@mail.utoronto.ca> | 2016-07-22 09:05:04 +0000 |
|---|---|---|
| committer | nanalelfe <nargiza.nosirova@mail.utoronto.ca> | 2016-07-22 09:06:06 +0000 |
| commit | 7d492571ff92dc5b5ac963ab156d27ef5b51f782 (patch) | |
| tree | 8b794607d5b218dfd574a1cedfaf5597136c06c5 /routes/index.js | |
| parent | 794c7c94d35d096bbb62a569da73ddeeb4a49c52 (diff) | |
Fixed login password check. Created new function retrievePassword in node_simple.js
Diffstat (limited to 'routes/index.js')
| -rw-r--r-- | routes/index.js | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/routes/index.js b/routes/index.js index 56401de..51e1cd2 100644 --- a/routes/index.js +++ b/routes/index.js @@ -171,7 +171,8 @@ router.get('/signup/failed', function(req, res, next) { router.get('/signin', function (req, res, next) { - res.render('signin', {csrfToken: req.csrfToken(), success: req.session.success, errors: req.session.errors}); + var msg = req.flash('error'); + res.render('signin', {csrfToken: req.csrfToken(), success: req.session.success, errors: req.session.errors, flashMsg: msg}); }); @@ -179,7 +180,7 @@ router.post('/signup', function(req, res, next) { req.check('fname', 'Please enter a valid first name.').notEmpty().withMessage('First name required.').isAlpha(); req.check('lname', 'Please enter a valid first name.').notEmpty().withMessage('Last name required.').isAlpha(); req.check('email', 'Enter a valid Email address').notEmpty().withMessage('Email required').isEmail(); - req.check('usrname', 'Enter a valid username').notEmpty().withMessage('Username required.').isAlphanumeric(); + req.check('usrname', 'Enter a valid username').notEmpty().withMessage('Username required.'); req.check('password', "Password should be between 6 and 12 characters.") .notEmpty().withMessage('Password required').isLength({min: 6, max: 12}); req.check('password', "The confirmation password doesn't match.").equals(req.body.confirmPassword); |
