Answer the question
In order to leave comments, you need to log in
Why doesn't the PassportJS code work?
Why the code does not work with off. site, slightly modified?
app.get("/login", function(req, res, next) {
passport.authenticate("local", function(err, user, info) {
if (err) {
return next(err);
}
if (!user) {
return res.render("login");
}
req.logIn(user, function(err) {
if (err) {
return next(err);
}
return res.redirect("/");
});
})(req, res, next);
});
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