diff --git a/controllers/user.js b/controllers/user.js index c2ecd1b890..2315602bc3 100644 --- a/controllers/user.js +++ b/controllers/user.js @@ -109,7 +109,10 @@ exports.postEmailSignup = function(req, res, next) { var user = new User({ email: req.body.email, - password: req.body.password + password: req.body.password, + profile : { + username: req.body.username + } }); User.findOne({ email: req.body.email }, function(err, existingUser) { diff --git a/views/account/email-signup.jade b/views/account/email-signup.jade index 86fb400d3b..765eed26da 100644 --- a/views/account/email-signup.jade +++ b/views/account/email-signup.jade @@ -6,7 +6,7 @@ block content input(type='hidden', name='_csrf', value=_csrf) .form-group .col-sm-6.col-sm-offset-3 - input.form-control(type='email', ng-model='email', ng-keypress='', name='email', id='email', placeholder='email', autofocus, required, autocomplete="off") + input.form-control(type='email', ng-model='email', ng-keypress='', name='email', id='email', placeholder='email', autofocus, required, autocomplete="off", unique-email='') .col-sm-6.col-sm-offset-3(ng-show="signupForm.email.$error.unique && !signupForm.email.$pristine") alert(type='danger') span.ion-close-circled