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
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.