jaredhanson / passport-local

Username and password authentication strategy for Passport and Node.js.
https://www.passportjs.org/packages/passport-local/?utm_source=github&utm_medium=referral&utm_campaign=passport-local&utm_content=about
MIT License
2.73k stars 497 forks source link

failureRedirect failed to redirect via route middleware #150

Open SK-CSE opened 7 years ago

SK-CSE commented 7 years ago

my case : i'm using app.use('/users', users); for routing user based stuff like login and app.use('/', routes); for other things in the below code written in user route : router.post('/login', passport.authenticate('local',{successRedirect : '/', failureRedirect : 'users/login', failureFlash:true}), function(req, res) { res.redirect('/'); }); failureRedirect is redirecting me to http://localhost:3000/users/users/login instead of http://localhost:3000/users/login. successRedirect is working absolutely fine and redirect to root dashboard. any suggestion would be appreciated