You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 17, 2025. It is now read-only.
// Allow this method to take a single credentials argument or two separate string arguments
316
-
varcredentials=emailOrCredentials;
317
-
if(typeofemailOrCredentials==="string"){
318
-
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.");
319
-
320
-
credentials={
321
-
email: emailOrCredentials,
322
-
password: password
323
-
};
312
+
// Throw an error if they are trying to pass in separate string arguments
313
+
if(typeofcredentials==="string"){
314
+
thrownewError("$createUser() expects an object containing 'email' and 'password', but got a string.");
324
315
}
325
316
326
317
try{
@@ -335,26 +326,16 @@
335
326
/**
336
327
* Changes the password for an email/password user.
337
328
*
338
-
* @param {Object|string} emailOrCredentials The email of the user whose password is to change
339
-
* or an object containing the email, old password, and new password of the user whose password
340
-
* is to change.
341
-
* @param {string} [oldPassword] The current password for the user.
342
-
* @param {string} [newPassword] The new password for the user.
329
+
* @param {Object} credentials An object containing the email, old password, and new password of
330
+
* the user whose password is to change.
343
331
* @return {Promise<>} An empty promise fulfilled once the password change is complete.
// Allow this method to take a single credentials argument or three separate string arguments
349
-
varcredentials=emailOrCredentials;
350
-
if(typeofemailOrCredentials==="string"){
351
-
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.");
352
-
353
-
credentials={
354
-
email: emailOrCredentials,
355
-
oldPassword: oldPassword,
356
-
newPassword: newPassword
357
-
};
336
+
// Throw an error if they are trying to pass in separate string arguments
337
+
if(typeofcredentials==="string"){
338
+
thrownewError("$changePassword() expects an object containing 'email', 'oldPassword', and 'newPassword', but got a string.");
358
339
}
359
340
360
341
try{
@@ -375,7 +356,7 @@
375
356
*/
376
357
changeEmail: function(credentials){
377
358
if(typeofthis._ref.changeEmail!=='function'){
378
-
thrownewError('$firebaseAuth.$changeEmail() requires Firebase version 2.1.0 or greater.');
359
+
thrownewError("$changeEmail() expects an object containing 'oldEmail', 'newEmail', and 'password', but got a string.");
379
360
}
380
361
381
362
vardeferred=this._q.defer();
@@ -392,23 +373,15 @@
392
373
/**
393
374
* Removes an email/password user.
394
375
*
395
-
* @param {Object|string} emailOrCredentials The email of the user to remove or an object
396
-
* containing the email and password of the user to remove.
397
-
* @param {string} [password] The password of the user to remove.
376
+
* @param {Object} credentials An object containing the email and password of the user to remove.
398
377
* @return {Promise<>} An empty promise fulfilled once the user is removed.
// Allow this method to take a single credentials argument or two separate string arguments
404
-
varcredentials=emailOrCredentials;
405
-
if(typeofemailOrCredentials==="string"){
406
-
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.");
407
-
408
-
credentials={
409
-
email: emailOrCredentials,
410
-
password: password
411
-
};
382
+
// Throw an error if they are trying to pass in separate string arguments
383
+
if(typeofcredentials==="string"){
384
+
thrownewError("$removeUser() expects an object containing 'email' and 'password', but got a string.");
412
385
}
413
386
414
387
try{
@@ -420,44 +393,20 @@
420
393
returndeferred.promise;
421
394
},
422
395
423
-
/**
424
-
* Sends a password reset email to an email/password user. [DEPRECATED]
425
-
*
426
-
* @deprecated
427
-
* @param {Object|string} emailOrCredentials The email of the user to send a reset password
428
-
* email to or an object containing the email of the user to send a reset password email to.
429
-
* @return {Promise<>} An empty promise fulfilled once the reset password email is sent.
this._log.warn("$sendPasswordResetEmail() has been deprecated in favor of the equivalent $resetPassword().");
433
-
434
-
try{
435
-
returnthis.resetPassword(emailOrCredentials);
436
-
}catch(error){
437
-
returnthis._q(function(resolve,reject){
438
-
returnreject(error);
439
-
});
440
-
}
441
-
},
442
396
443
397
/**
444
398
* Sends a password reset email to an email/password user.
445
399
*
446
-
* @param {Object|string} emailOrCredentials The email of the user to send a reset password
447
-
* email to or an object containing the email of the user to send a reset password email to.
400
+
* @param {Object} credentials An object containing the email of the user to send a reset
401
+
* password email to.
448
402
* @return {Promise<>} An empty promise fulfilled once the reset password email is sent.
449
403
*/
450
-
resetPassword: function(emailOrCredentials){
404
+
resetPassword: function(credentials){
451
405
vardeferred=this._q.defer();
452
406
453
-
// Allow this method to take a single credentials argument or a single string argument
454
-
varcredentials=emailOrCredentials;
455
-
if(typeofemailOrCredentials==="string"){
456
-
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.");
457
-
458
-
credentials={
459
-
email: emailOrCredentials
460
-
};
407
+
// Throw an error if they are trying to pass in a string argument
408
+
if(typeofcredentials==="string"){
409
+
thrownewError("$resetPassword() expects an object containing 'email', but got a string.");
0 commit comments