Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

90
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda