2

Calling firebase.auth().createUserWithEmailAndPassword(email, password) is causing "QUOTA_EXCEEDED : Exceeded quota for email lookup." if a user tries to create an account with an existing email.

Here is my code (using "firebase": "7.6.2"):

 firebase.auth().createUserWithEmailAndPassword(email, password)
      .then(result => {
         result.user.sendEmailVerification(actionCodeSettings);
      })
      .catch(error => {
        console.log(error);
        // Handling error for user
      });

The error is handled correctly. The error is catched with

  "error": {
    "code": 400,
    "message": "EMAIL_EXISTS",
    "errors": [
      {
        "message": "EMAIL_EXISTS",
        "domain": "global",
        "reason": "invalid"
      }
    ]
  }
}

Nevertheless firebase is calling createAuthUri to create the URI used by the IdP to authenticate the user. This call is triggered in a loop till it runs into the quota. Has anybody the same problem? How can i cancel the calls of createAuthUri to avoid to run against the quota?

enter image description here enter image description here

Simone Groß
  • 101
  • 1
  • 5
  • Hi, This is strange. I have used your same code and didn't get any kind of quota exceed error. I just receive an error `The email address is already in use by another account.`. are you doing anything else in the context of this user create like looping? – Methkal Khalawi Sep 30 '20 at 13:45

1 Answers1

2

Solved the problem! It was not caused by firebase.auth().createUserWithEmailAndPassword(email, password) as I expected. There is a component triggered to render an alert on error (didn't show that in the snippet). Inside this component there was the side effect caused by calling firebase on each re-render of the component. Unfortunately, the component caused the re-render on each function call to firebase by itself.

Simone Groß
  • 101
  • 1
  • 5