how to get current user in firebase js dinamically code example

Example 1: firebase get current user javascript

var user = firebase.auth().currentUser;

if (user) {
  // User is signed in.
} else {
  // No user is signed in.
}

Example 2: update photoURL firebase

this.$fireAuth.currentUser.updateProfile({
    displayName: '',
    photoURL: '',
    email: ''
  })
  .then((r) => {
    console.log(r)
  })
  .catch((e) => {
  console.log(e)
})

Example 3: firebase.auth.currentuser

var user = firebase.auth().currentUser;if (user) {  // User is signed in.} else {  // No user is signed in.}

Tags:

Java Example