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

361
Vistas
How can I redirect the parent page after OAuth 2 flow is complete?

My current flow is such:

  1. User clicks login to third party
  2. Upon grant, the third party redirects to configured redirect uri with code
  3. Forward code to backend to verify, etc.
  4. Return success/failure

My frontend is coded to close the popup when the login is successful, but the parent page still just remains the same - standard login page. The goal would be to redirect that page.

I've tried to add an event listener on the window object, but it's not working.

...
  const loginWindow = window.open(oAuthUrl,'targetWindow','toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,height=450')
  loginWindow.onbeforeunload = function () {
    alert("new window closed");
  }
};

Is this possible?

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

0

Ok, I have something that seems to be working:

        fetch('http://localhost:8080/user/login', requestOptions)
            .then(response => response.json())
            .then(data => window.close())
            .then(data => window.opener.location.replace("/"))
    }

window.opener allows you to access the parent window.

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