how set username in firebse auth code example

Example 1: 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.});

Example 2: onstatechange firebase cant get stsTokenManager

firebase.auth().onAuthStateChanged(function(user) {
  if (user) {
    user.getIdToken().then(function(idToken) {
      console.log(idToken);
    });
  }
});

Tags:

Java Example