I'm following this guide for implementing Passport for signup:
https://scotch.io/tutorials/easy-node-authentication-setup-and-local
Everything works well, except that Passport does not redirect on successful signup. This is my code that I'm using to redirect on a successful signup:
// POST /signup
router.post('/signup', passport.authenticate('local-signup', {
successRedirect : '/dashboard',
failureRedirect : '/signup',
failureFlash: true
}));
I have verified that the user is created in the database. failureRedirect works! It's just on successRedirect that the web page hangs like it's not being successfully redirected.
Is there an incompatibility issue with passport and Express 4 Router? I see all examples of Passport using app.post() instead of router.post().
Thanks!