Answer the question
In order to leave comments, you need to log in
What if you need to change the module received through npm?
I had a problem with the passport module in conjunction with connect-pg-simple.
The problem is known.
Although the question is closed, the solution did not fit me. I made a small change (a couple of lines) in passport: it allows for failureRedirect to specify a function instead of a path, something like:
exports.login = passport.authenticate('local', {
failureRedirect: function(req,res){
req.session.save(() => {
res.redirect('/login');
})},
failureFlash: true,
successRedirect: '/',
successFlash: false
});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question