Q:

firebase auth get 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.}); 
1
var user = firebase.auth().currentUser;var name, email, photoUrl, uid, emailVerified;if (user != null) {  name = user.displayName;  email = user.email;  photoUrl = user.photoURL;  emailVerified = user.emailVerified;  uid = user.uid;  // The user's ID, unique to the Firebase project. Do NOT use                   // this value to authenticate with your backend server, if                   // you have one. Use User.getToken() instead.}
0
firebase.auth().onAuthStateChanged(function(user) {  if (user) { 
// User is signed in. 
} 
  else {   
    // No user is signed in.
  }});
0

New to Communities?

Join the community