|
5 | 5 |
|
6 | 6 | // Define a service which provides user authentication and management. |
7 | 7 | angular.module('firebase').factory('$firebaseAuth', [ |
8 | | - '$q', function($q) { |
| 8 | + '$q', '$log', function($q, $log) { |
9 | 9 | // This factory returns an object containing the current authentication state of the client. |
10 | 10 | // This service takes one argument: |
11 | 11 | // |
|
14 | 14 | // The returned object contains methods for authenticating clients, retrieving authentication |
15 | 15 | // state, and managing users. |
16 | 16 | return function(ref) { |
17 | | - var auth = new FirebaseAuth($q, ref); |
| 17 | + var auth = new FirebaseAuth($q, $log, ref); |
18 | 18 | return auth.construct(); |
19 | 19 | }; |
20 | 20 | } |
21 | 21 | ]); |
22 | 22 |
|
23 | | - FirebaseAuth = function($q, ref) { |
| 23 | + FirebaseAuth = function($q, $log, ref) { |
24 | 24 | this._q = $q; |
| 25 | + this._log = $log; |
25 | 26 |
|
26 | 27 | if (typeof ref === 'string') { |
27 | 28 | throw new Error('Please provide a Firebase reference instead of a URL when creating a `$firebaseAuth` object.'); |
|
297 | 298 | // Allow this method to take a single credentials argument or two separate string arguments |
298 | 299 | var credentials = emailOrCredentials; |
299 | 300 | 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 | + |
300 | 303 | credentials = { |
301 | 304 | email: emailOrCredentials, |
302 | 305 | password: password |
|
330 | 333 | // Allow this method to take a single credentials argument or three separate string arguments |
331 | 334 | var credentials = emailOrCredentials; |
332 | 335 | 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 | + |
333 | 338 | credentials = { |
334 | 339 | email: emailOrCredentials, |
335 | 340 | oldPassword: oldPassword, |
|
362 | 367 | // Allow this method to take a single credentials argument or two separate string arguments |
363 | 368 | var credentials = emailOrCredentials; |
364 | 369 | 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 | + |
365 | 372 | credentials = { |
366 | 373 | email: emailOrCredentials, |
367 | 374 | password: password |
|
388 | 395 | * @return {Promise<>} An empty promise fulfilled once the reset password email is sent. |
389 | 396 | */ |
390 | 397 | 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()."); |
392 | 399 | return this.resetPassword(emailOrCredentials); |
393 | 400 | }, |
394 | 401 |
|
|
405 | 412 | // Allow this method to take a single credentials argument or a single string argument |
406 | 413 | var credentials = emailOrCredentials; |
407 | 414 | 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 | + |
408 | 417 | credentials = { |
409 | 418 | email: emailOrCredentials |
410 | 419 | }; |
|
0 commit comments