0

I am writing a EmberJS web application. I want to create and authenticate the user using firebase. I am using the emberfire

https://github.com/firebase/emberfire

I am not able to create a user using the emberfire. There is no info regarding user creation.

Any thoughts?

Thanks

bjkpriyanka
  • 151
  • 1
  • 11

1 Answers1

0

This is example from my signup component:

actions: {
    signUp: function () {
        let model = this.get('model');
        let ref = this.get('firebaseApp').auth();
        ref.createUserWithEmailAndPassword(model.get('email'), model.get('password'))
            .then(function (userData) {
                this.get('session')
                    .open('firebase', {
                        provider: 'password',
                        'email': model.get('email'),
                        'password': model.get('password')
                    })
                    .then(function () {
                        model.set('id', userData.uid);
                        model.save()
                            .then(function () {
                                this.get('router').transitionTo('login');
                            }.bind(this))
                        ;
                    }.bind(this))
                    .catch(function (error) {
                        this.set('errorMessage', error.message);
                    }.bind(this));
            }.bind(this))
            .catch(function (error) {
                this.set('errorMessage', error.message);
            }.bind(this))
        ;
    }
}
galmi
  • 39
  • 1
  • 2