aboutsummaryrefslogtreecommitdiff
path: root/routes/user.js
diff options
context:
space:
mode:
authornanalelfe <nargiza.nosirova@mail.utoronto.ca>2016-07-23 02:12:02 +0000
committernanalelfe <nargiza.nosirova@mail.utoronto.ca>2016-07-23 02:12:02 +0000
commit5240b6ff1bd881b482caba3dc3c1b30597fb1353 (patch)
tree2c29a1c0f5f4e036039eb71c2e78f3fee7c7d2e0 /routes/user.js
parent107d6ad8cfeead5bafe90f2005fe341c849f36df (diff)
Fixed session storage. Fixed optional phone number in signup
Diffstat (limited to 'routes/user.js')
-rw-r--r--routes/user.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/routes/user.js b/routes/user.js
index 39b41d2..840930a 100644
--- a/routes/user.js
+++ b/routes/user.js
@@ -49,7 +49,9 @@ 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);
- req.check('phone_num', 'Please enter a valid phone number').isMobilePhone('en-CA').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();