firebase.initializeApp(firebaseConfig);
const auth = firebase.auth();
function signUp(){
var email = document.getElementById("emailsu");
var password = document.getElementById("passwordsu");
const promise = auth.createUserWithEmailAndPassword(email.value, password.value);
promise.catch(e => alert(e.message));
alert("Signed Up");
}
function signIn(){
var email = document.getElementById("email");
var password = document.getElementById("password");
const promise = auth.signInWithEmailAndPassword(email.value, password.value);
promise.catch(e => alert(e.message));
}
auth.onAuthStateChanged(function(user){
if(user){
window.location.assign("Landing Page");
}else{
//no user is signed in
}
});
function signOut(){
auth.signOut();
alert("Signed Out");
window.location.replace("index.html");
}
This is my authentication JavaScript And when I tried to link this file using script tag to access UID pages other than login page... It starts to reload recursively... I want to Access UIDs and save them in database as DOCUMENT name so I can fetch the data using UID of the user
the folder contains 6 Different HTML pages but it only authenticates the login page