From 324ca4e6bfe0cd61a279df9ca73103c11e9dba45 Mon Sep 17 00:00:00 2001 From: jacobawenger Date: Tue, 2 Dec 2014 22:18:41 -0800 Subject: [PATCH 1/2] Return uid of created user --- src/FirebaseAuth.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/FirebaseAuth.js b/src/FirebaseAuth.js index 8c478e9c..e6af6513 100644 --- a/src/FirebaseAuth.js +++ b/src/FirebaseAuth.js @@ -193,20 +193,20 @@ /*********************/ /* User Management */ /*********************/ - // Creates a new email/password user. Note that this function only creates the user, if you - // wish to log in as the newly created user, call $authWithPassword() after the promise for - // this method has been resolved. + // Creates a new email/password user. Returns a promise fulfilled with the uid of the created + // user. Note that this function only creates the user, if you wish to log in as the newly + // created user, call $authWithPassword() after the promise for this method has been resolved. createUser: function(email, password) { var deferred = this._q.defer(); this._ref.createUser({ email: email, password: password - }, function(error) { + }, function(error, user) { if (error !== null) { deferred.reject(error); } else { - deferred.resolve(); + deferred.resolve(user && user.uid); } }); From b0554df23b19bdd3e85df9012570988bcc96891d Mon Sep 17 00:00:00 2001 From: jacobawenger Date: Tue, 2 Dec 2014 22:20:46 -0800 Subject: [PATCH 2/2] Make $createuser() resolve entire user object, not just uid --- src/FirebaseAuth.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/FirebaseAuth.js b/src/FirebaseAuth.js index e6af6513..af62220d 100644 --- a/src/FirebaseAuth.js +++ b/src/FirebaseAuth.js @@ -206,7 +206,7 @@ if (error !== null) { deferred.reject(error); } else { - deferred.resolve(user && user.uid); + deferred.resolve(user); } });