Thursday 23 April 2020

Passport js question

I am trying to make a user authentication system with Passport. I used this github repository, and everything seems to work except the code below. When passport is finished authenticating (done callback from users.js route is hit) the successRedirect isn't happening. However when I kill the server the success page loads in the URL. Can anyone tell me what I can do to solve this router.post('/login', (req,res,next)=> { passport.authenticate('local', { successRedirect: '/dashboard', failureRedirect: '/users/login', failureFlash: true })(req,res,next); }); Thanks for your help!

Submitted April 23, 2020 at 04:33PM by doesntspank

No comments:

Post a Comment