Closed Usama-Aslam closed 4 years ago
Github Link : https://github.com/StackBeans/Review-App I can't access req.user when i send get/post or any call from Postman in localhost env. I want to build REST API using Postman. Its working fine in browser.
router.get("/facebook", passport.authenticate("facebook")); router.get( "/facebook/callback", passport.authenticate("facebook", { successRedirect: "/api/auth/current", failureRedirect: "/api/auth/facebook", }) );
The /current route is just sending res.send(req.user)
router.get("/current", userCtrl.getUserInfo); //getUserInfo(req, res) { // if (req.user) res.send(req.user); // else res.send({ error: "req.user not found" }); // }
What should i do to get req.user when making call API using Postman. Please help me out. I am stuck.
Github Link : https://github.com/StackBeans/Review-App I can't access req.user when i send get/post or any call from Postman in localhost env. I want to build REST API using Postman. Its working fine in browser.
The /current route is just sending res.send(req.user)
What should i do to get req.user when making call API using Postman. Please help me out. I am stuck.