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

211
Vistas
only redirect a user on login not in registration in firebase javascript
firebase.auth().onAuthStateChanged(user => {
  if(user) {
    window.location = 'home.html';
  }
});

I am trying to make a login and registration page, I have done everything but the problem is I only want to redirect user on when he clicks login in button not on register the above code is not helping it redirects even when registering. Any information you can provide me would be greatly helpful in this matter thank you

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

0

what about this:

document.getElementById("login-button").addEventListener("click", function(){
  window.location = 'home.html';
});

this is just a simple JS code for sending you over to other page when element with id="login-button" is clicked.

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