Skip to content
This repository was archived by the owner on Mar 17, 2025. It is now read-only.
This repository was archived by the owner on Mar 17, 2025. It is now read-only.

$createUser promise not returning user object #507

@edwinwright

Description

@edwinwright

I'm trying to create a new user, then grab the uid so that I can save additional user data during registration. I'm finding that there is no user object being returning as per the doco in https://github.com/firebase/angularfire/blob/master/src/FirebaseAuth.js.

Here is my Authentication service...

myApp.factory('Authentication',
  function($firebaseAuth, FIREBASE_URL, $location) {

  var ref = new Firebase(FIREBASE_URL);
  var authObj = $firebaseAuth(ref);

  var myObj = {
    register: function(user) {
      return authObj.$createUser(user.email, user.password)
        .then(function(authData) {

          console.log(authData); // returns undefined

        });
    },

    login: function(user) {
      return authObj.$authWithPassword({
        email: user.email,
        password: user.password
      });
    },

    logout: function() {
      return authObj.$unauth();
    }
  }

  return myObj;

});

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions