I have the following routes…
router.route("/").get(passport.authenticate("auth0", {
scope: "openid email profile",
}), api.hello);
router.get("/callback", (req, res, next)=>{
passport.authenticate("auth0", {
scope: "openid email profile",
}, (err, user, info) => {
if (err) return next(err);
if (!user) return res.redirect("/login");
req.logIn(user, (err) => {
if (err) return next(err);
res.redirect("/");
});
})(req, res, next);
});
But when I run I get the login page and then I get /callback redirecting back to / which redirects back to callback. I am basically following the steps here (Node.js and Express Tutorial: Authentication Using Passport)
What am I missing?