Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

update user information in firebase

I am using angularFire in its latest version 2.0.1, but I see information on how to update information as "displayName" try to obtain user information with firebase.User() but I get error "getApi" I am misguided quisas how to update the information a user created earlier

like image 825
Luis Ruiz Figueroa Avatar asked Jun 03 '16 16:06

Luis Ruiz Figueroa


People also ask

Where is user data stored in Firebase?

Firebase users have a fixed set of basic properties—a unique ID, a primary email address, a name and a photo URL—stored in the project's user database, that can be updated by the user (iOS, Android, web).

How do I add a username to Firebase authentication?

You create a new user in your Firebase project by calling the createUserWithEmailAndPassword method or by signing in a user for the first time using a federated identity provider, such as Google Sign-In or Facebook Login.


1 Answers

I found a solution for this problem. You can do the following:

var user = firebase.auth().currentUser;
user.updateProfile({
  displayName: vm.form.username
}).then(function(response) {
  //Success
}, function(error) {
  //Error
  console.log(error);
});
like image 89
StS Avatar answered Nov 12 '22 19:11

StS