Created
August 22, 2014 03:45
-
-
Save DapperFox/5ac56b9ddb7aa5d4d4d1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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