firebase app.auth().currentUser code example
Example 1: google auth.onstatechange
firebase.auth().onAuthStateChanged(function(user) { if (user) {
// User is signed in.
}
else {
// No user is signed in.
}});
Example 2: firebase auth update current user
var user = firebase.auth().currentUser;user.updateProfile({ displayName: "Jane Q. User", photoURL: "https://example.com/jane-q-user/profile.jpg"}).then(function() { // Update successful.}).catch(function(error) { // An error happened.});