Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

89
Views
How do I pass the user's server side request to the client side?

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");
});
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!