Skip to content

Instantly share code, notes, and snippets.

@DapperFox
Created August 22, 2014 03:45
Show Gist options
  • Select an option

  • Save DapperFox/5ac56b9ddb7aa5d4d4d1 to your computer and use it in GitHub Desktop.

Select an option

Save DapperFox/5ac56b9ddb7aa5d4d4d1 to your computer and use it in GitHub Desktop.
app.post('/register', function(req, res) {
console.log(req.body.username + req.body.firstName + req.body.password);
User.register(new User({
username: req.body.username,
firstName: req.body.firstName,
role: 'Client',
completion: false
}), req.body.password, function(err, account) {
if (err) {
console.log(err);
return res.render('register', {
account: account
});
} else {
passport.authenticate('local')(req, res, function() {
res.redirect('/signup');
});
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment