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

Commit b88d273

Browse files
author
jwngr
committed
Improved error messages for auth methods
1 parent 8470e77 commit b88d273

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/FirebaseAuth.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@
311311

312312
// Throw an error if they are trying to pass in separate string arguments
313313
if (typeof credentials === "string") {
314-
throw new Error("Passing in credentials to $createUser() as individual arguments has been removed in favor of a single credentials argument. See the AngularFire API reference for details.");
314+
throw new Error("$createUser() expects an object containing 'email' and 'password', but got a string.");
315315
}
316316

317317
try {
@@ -335,7 +335,7 @@
335335

336336
// Throw an error if they are trying to pass in separate string arguments
337337
if (typeof credentials === "string") {
338-
throw new Error("Passing in credentials to $changePassword() as individual arguments has been removed in favor of a single credentials argument. See the AngularFire API reference for details.");
338+
throw new Error("$changePassword() expects an object containing 'email', 'oldPassword', and 'newPassword', but got a string.");
339339
}
340340

341341
try {
@@ -356,7 +356,7 @@
356356
*/
357357
changeEmail: function(credentials) {
358358
if (typeof this._ref.changeEmail !== 'function') {
359-
throw new Error('$firebaseAuth.$changeEmail() requires Firebase version 2.1.0 or greater.');
359+
throw new Error("$changeEmail() expects an object containing 'oldEmail', 'newEmail', and 'password', but got a string.");
360360
}
361361

362362
var deferred = this._q.defer();
@@ -381,7 +381,7 @@
381381

382382
// Throw an error if they are trying to pass in separate string arguments
383383
if (typeof credentials === "string") {
384-
throw new Error("Passing in credentials to $removeUser() as individual arguments has been removed in favor of a single credentials argument. See the AngularFire API reference for details.");
384+
throw new Error("$removeUser() expects an object containing 'email' and 'password', but got a string.");
385385
}
386386

387387
try {
@@ -406,7 +406,7 @@
406406

407407
// Throw an error if they are trying to pass in a string argument
408408
if (typeof credentials === "string") {
409-
throw new Error("Passing in credentials to $resetPassword() as individual arguments has been removed in favor of a single credentials argument. See the AngularFire API reference for details.");
409+
throw new Error("$resetPassword() expects an object containing 'email', but got a string.");
410410
}
411411

412412
try {

0 commit comments

Comments
 (0)