Email signup for angularized, user.js controller modified so that username can be stored upon signup

This commit is contained in:
terakilobyte
2015-01-09 21:33:50 -05:00
parent 02eb3b5914
commit 11bc776ffb
2 changed files with 5 additions and 2 deletions

View File

@ -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) {

View File

@ -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