vendredi 10 mars 2017

Firebase 3: Create new user with Emberfire and Save additional fields (DS)

What is the best way to create a new user in firebase using emberfire/torii while saving the users additional information using ember data?

My signIn action is working correctly and looks like this:

signIn: function(provider, email, password) {
      let self = this;
      this.controller.get('session').open('firebase', {provider: provider, email: email, password: password}).then(function(data) {        
        self.transitionToRoute('index');
        console.log(data.currentUser);
      }).catch(function(error) {
        console.log(error.message);
      });

},

Now I'm trying to setup a createUser action, but not sure how to create it in order to both save/authenticate user in firebase, as well as saving additional fields such as fullName and userName. I would also like to have an avatar for each user, but the user will have to add this image from their profile.

I've been testing with the code tstirrat is using in the second comment here http://ift.tt/2mtCwEq but can't seem to get it working.

Any help on the best way to achieve this is much appreciated. Thank you!




Aucun commentaire:

Enregistrer un commentaire