I don't know if I phrased the title correctly, so sorry if it confused you.
I have two servers running (using different ports), one is my client side running on React, and the other one is my server side running on Express.
I'm trying to have the user log in via Steam, so I'm using the passport-steam library. Basically, when the user logs in on steam, it passes the user data to the server-side req session, but I need it to be on the client-side so it can access the data and load it on the website.
Here's some code if that helps
// /routes/auth.js
// /AUTH ROUTER
// GET Request the CLIENT will send to get their info
router.get("/user", ensureAuthenticated, function (req, res) {
res.json(req.session.user);
// returns undefined because their session is saved on the server side
});
// GET Requests used to sign in and authenticate
router.get("/steam", passport.authenticate("steam", { failureRedirect: "http://localhost:3000/login" }), function (req, res) {
res.redirect("http://localhost:3000");
});
router.get("/steam/return", passport.authenticate("steam", { failureRedirect: "http://localhost:3000/login" }), async function (req, res) {
res.redirect("http://localhost:3000");
});