Patrick M.
Patrick M.

Reputation: 819

Firebase Domain Whitelist not working for sendEmailVerification

In my onboarding work-flow, I'm trying to verify a newly created user's email with this code (as per example in the docs)

verifyEmail(): firebase.Promise<any> {

    const actionCodeSettings: firebase.auth.ActionCodeSettings = {
      url: 'http://localhost:4200/main/profile',
      handleCodeInApp: false
    };

    return this.afAuth.auth.currentUser.sendEmailVerification(actionCodeSettings);
  }

Unfortunately, the result of the promise is this error:

{code: "auth/unauthorized-continue-uri", message: "Domain not whitelisted by project"}

However, in Firebase console, 'localhost' is whitelisted (by default). If I change localhost by my current IP, which is also whitelisted, it doesn't work either.

Here is the request from Chrome Dev tools:

Request URL:https://www.googleapis.com/identitytoolkit/v3/relyingparty/getOobConfirmationCode?key=blahblahblah
Request Method: POST
Status Code: 400 
Request Payload:
{
    "requestType":"VERIFY_EMAIL",
    "idToken":"blahblahblahblah",
    "continueUrl":"https://localhost:4200/main/profile",
    "canHandleCodeInApp":false
}

And this is my Firebase console: enter image description here

Looks like a bug but wanted to be sure before raising an issue to Firebase guys.

Any thoughts?

Upvotes: 13

Views: 11205

Answers (1)

eozzy
eozzy

Reputation: 68650

For others who have this problem with a domain name make sure to also include 2 domains one with www and without.

Credit to Jonathan002

Upvotes: 6

Related Questions