Firebase javascript auth user displaying null even though user is signed in
问题 I followed the Firebase docs for web development and I used the user.updateProfile method to add a display name to the user's profile. After signing in, I used console.log(user) and it worked but when I call updateProfile() , the value of user is null. Any solutions? Here is the relevant code: var button = document.getElementById("profile-button"); var username = document.getElementById("username-Box").value; var user = firebase.auth().currentUser; auth.onAuthStateChanged(user =>{ console.log