Nothing here yet.
No blogs yet.
This is where I got stuck actually. "/twitter", passport.authenticate("twitter", { scope: ["profile"] })); "/twitter/callback", passport.authenticate("twitter", { failureRedirect: "/login" }), controllers.authController.twitter_callback ); twitter_callback: async (req, res) => { try { const twitter_user = await req.user; const user = await User.create({ name: twitter_user.displayName, email: twitter_user.emails[0].value }); const token = user.generateAuthToken(); res.header("x_auth_token", token).json({ msg: "callback called", status: 200 }); // res.redirect("/"); } catch (err) { console.log(err); // res.status(500).json(err); } } I'm having trouble with saving the header token in cookie. I need to store the header token in cookie.