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

Commit e876432

Browse files
author
jacobawenger
committed
Updated changelog and added more deprecation warnings
1 parent 0c183d4 commit e876432

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

changelog.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
deprecated - Passing in credentials to the user management methods of `$firebaseAuth` as individual arguments has been deprecated in favor of a single credentials argument.
2+
deprecated - Deprecated `$firebaseAuth.$sendPasswordResetEmail()` in favor of the functionally equivalent `$firebaseAuth.$resetPassword()`.

src/FirebaseAuth.js

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
// Define a service which provides user authentication and management.
77
angular.module('firebase').factory('$firebaseAuth', [
8-
'$q', function($q) {
8+
'$q', '$log', function($q, $log) {
99
// This factory returns an object containing the current authentication state of the client.
1010
// This service takes one argument:
1111
//
@@ -14,14 +14,15 @@
1414
// The returned object contains methods for authenticating clients, retrieving authentication
1515
// state, and managing users.
1616
return function(ref) {
17-
var auth = new FirebaseAuth($q, ref);
17+
var auth = new FirebaseAuth($q, $log, ref);
1818
return auth.construct();
1919
};
2020
}
2121
]);
2222

23-
FirebaseAuth = function($q, ref) {
23+
FirebaseAuth = function($q, $log, ref) {
2424
this._q = $q;
25+
this._log = $log;
2526

2627
if (typeof ref === 'string') {
2728
throw new Error('Please provide a Firebase reference instead of a URL when creating a `$firebaseAuth` object.');
@@ -297,6 +298,8 @@
297298
// Allow this method to take a single credentials argument or two separate string arguments
298299
var credentials = emailOrCredentials;
299300
if (typeof emailOrCredentials === "string") {
301+
this._log.warn("Passing in credentials to $createUser() as individual arguments has been deprecated in favor of a single credentials argument. See the AngularFire API reference for details.");
302+
300303
credentials = {
301304
email: emailOrCredentials,
302305
password: password
@@ -330,6 +333,8 @@
330333
// Allow this method to take a single credentials argument or three separate string arguments
331334
var credentials = emailOrCredentials;
332335
if (typeof emailOrCredentials === "string") {
336+
this._log.warn("Passing in credentials to $changePassword() as individual arguments has been deprecated in favor of a single credentials argument. See the AngularFire API reference for details.");
337+
333338
credentials = {
334339
email: emailOrCredentials,
335340
oldPassword: oldPassword,
@@ -362,6 +367,8 @@
362367
// Allow this method to take a single credentials argument or two separate string arguments
363368
var credentials = emailOrCredentials;
364369
if (typeof emailOrCredentials === "string") {
370+
this._log.warn("Passing in credentials to $removeUser() as individual arguments has been deprecated in favor of a single credentials argument. See the AngularFire API reference for details.");
371+
365372
credentials = {
366373
email: emailOrCredentials,
367374
password: password
@@ -388,7 +395,7 @@
388395
* @return {Promise<>} An empty promise fulfilled once the reset password email is sent.
389396
*/
390397
sendPasswordResetEmail: function(emailOrCredentials) {
391-
console.warn("$sendPasswordResetEmail() has been deprecated in favor of the equivalent $resetPassword().");
398+
this._log.warn("$sendPasswordResetEmail() has been deprecated in favor of the equivalent $resetPassword().");
392399
return this.resetPassword(emailOrCredentials);
393400
},
394401

@@ -405,6 +412,8 @@
405412
// Allow this method to take a single credentials argument or a single string argument
406413
var credentials = emailOrCredentials;
407414
if (typeof emailOrCredentials === "string") {
415+
this._log.warn("Passing in credentials to $resetPassword() as individual arguments has been deprecated in favor of a single credentials argument. See the AngularFire API reference for details.");
416+
408417
credentials = {
409418
email: emailOrCredentials
410419
};

0 commit comments

Comments
 (0)