Skip to content

Commit

Permalink
Fix bug with email registration.
Browse files Browse the repository at this point in the history
  • Loading branch information
martindale committed Sep 30, 2015
1 parent 8bc974c commit 6fb5494
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions soundtrack.js
Original file line number Diff line number Diff line change
Expand Up @@ -880,10 +880,12 @@ app.post('/register', function(req, res) {
return res.redirect('/register');
}

Person.register(new Person({
username : req.body.username,
email: req.body.email
}), req.body.password, function(err, user) {
var body = req.body;
if (!body.email) {
delete body.email;
}

Person.register(new Person(body), req.body.password, function(err, user) {
if (err) {
req.flash('error', 'Something went wrong: ' + err);
return res.render('register', { user : user });
Expand Down

0 comments on commit 6fb5494

Please sign in to comment.