diff options
Diffstat (limited to 'controllers')
-rw-r--r-- | controllers/user.js | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/controllers/user.js b/controllers/user.js index 3f7b4a1..31afdfc 100644 --- a/controllers/user.js +++ b/controllers/user.js @@ -12,8 +12,7 @@ module.exports = { password: bcrypt.hashSync(req.body.password) }); newUser.save().then(() => { - req.flash('msg', 'You successfully registered.'); - res.redirect('/login'); + req.login(newUser, () => res.redirect('/new-post')); }); } else { |