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

199
Vistas
Why is ensureLogin not working when I am using passport-auth0-openidconnect?

I have a simple express webapp and I am trying to add auth. Everything seems to work fine, I see the connect.sid in the cookies etc, but when I tried to access the following endpoint...

this.app.get("/user",
  ensureLoggedIn("/login"),
  function(req, res) {
    res.json(req.user || {});
});

It redirects me to login instead of letting me through. What am I missing?

When I debug I can see that the problem is req.isAuthenticated is false. I am not sure why because I login and see the cookie. I can also logout and be presented with the Login screen so I am confused.

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

In my case I had been calling passport.session() before I setup express session. This fixed it....

enter image description here

about 4 years ago · Juan Pablo Isaza Denunciar
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