Email signup for angularized, user.js controller modified so that username can be stored upon signup
This commit is contained in:
@ -109,7 +109,10 @@ exports.postEmailSignup = function(req, res, next) {
|
|||||||
|
|
||||||
var user = new User({
|
var user = new User({
|
||||||
email: req.body.email,
|
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) {
|
User.findOne({ email: req.body.email }, function(err, existingUser) {
|
||||||
|
@ -6,7 +6,7 @@ block content
|
|||||||
input(type='hidden', name='_csrf', value=_csrf)
|
input(type='hidden', name='_csrf', value=_csrf)
|
||||||
.form-group
|
.form-group
|
||||||
.col-sm-6.col-sm-offset-3
|
.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")
|
.col-sm-6.col-sm-offset-3(ng-show="signupForm.email.$error.unique && !signupForm.email.$pristine")
|
||||||
alert(type='danger')
|
alert(type='danger')
|
||||||
span.ion-close-circled
|
span.ion-close-circled
|
||||||
|
Reference in New Issue
Block a user