aboutsummaryrefslogtreecommitdiff
path: root/routes
diff options
context:
space:
mode:
authornanalelfe <nargiza.nosirova@mail.utoronto.ca>2016-07-23 03:58:19 +0000
committernanalelfe <nargiza.nosirova@mail.utoronto.ca>2016-07-23 03:58:19 +0000
commit218b2c014b1ab68ee8289210820d7b6b742bceef (patch)
tree16ffa5e8dc732c34737ef8e8ee036419d53b5aa9 /routes
parent5240b6ff1bd881b482caba3dc3c1b30597fb1353 (diff)
Populated user info into user_profile.hbs
Diffstat (limited to 'routes')
-rw-r--r--routes/user.js8
1 files changed, 3 insertions, 5 deletions
diff --git a/routes/user.js b/routes/user.js
index 840930a..014a7d2 100644
--- a/routes/user.js
+++ b/routes/user.js
@@ -49,10 +49,11 @@ router.post('/signup', loggedOut, function(req, res, next) {
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);
+
+ // phone number optional
if (req.body.phone_num){
req.check('phone_num', 'Please enter a valid phone number').isMobilePhone('en-CA');
}
- // password has to be at least 4 characters long
var errors = req.validationErrors();
if (errors) {
@@ -68,14 +69,11 @@ router.post('/signup', loggedOut, function(req, res, next) {
})(req, res);
}
- //res.redirect('/signup');
-
});
router.post('/signin', loggedOut, function(req, res, next) {
req.check('usrname', 'Username field is empty.').notEmpty();
req.check('password', "Password field is empty.").notEmpty();
- // password has to be at least 4 characters long
var errors = req.validationErrors();
if (errors) {
@@ -89,9 +87,9 @@ router.post('/signin', loggedOut, function(req, res, next) {
failureRedirect: '/user/signin',
failureFlash: true
})(req, res);
-
}
+
});
module.exports = router;