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

209
Views
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 answers
Answer question

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 Report
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!