failureRedirect failed to redirect via route middleware
SK-CSE opened this issue · 0 comments
SK-CSE commented
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