firebase.auth().onAuthStateChanged(function(user) {
if (user) {
// User is signed in.
console.log("ADMIN is IN");
// window.location.href = "admin.html"
} else {
// No user is signed in.
console.log("No ADMIN");
window.location.href = "login.html";
}
});
function logout(){
console.log("Function RAN");
firebase.auth().signOut()
.then(function() {
console.log("FINE LOGOUT WORKED");
window.location.href = "login.html";
})
.catch(function(error) {
console.log(error);
});
}
Question 1:- here is my code it work fine on localhost but when i deploy it to firebase hosting it doesn't work?
Question 2:- Can i generate static html files from Cloud function to serve on firebase hosting.
firebase.js
andfirebase-app.js
andfirebase-auth.js
. Can you remove one version and keep the other. I can see the issue in your app but I am having a problem replicating it on my end. - bojeil