2

I followed the official guide to enable AppCheck. I registered my site for reCAPTCHA v3 and registered my app to use AppCheck in the firebase console. I have not yet enforced anything.

In one of my NgModules I did the following:

import {
  initializeAppCheck,
  ReCaptchaV3Provider,
  provideAppCheck,
} from "@angular/fire/app-check";

...

provideAppCheck(() => {
  return initializeAppCheck(getApp(), {
    provider: new ReCaptchaV3Provider(environment.firebase.recaptchaKey),
    isTokenAutoRefreshEnabled: true,
  });
}),

After doing what I've mentioned above, my app no longer works. I get the following error once when my site loads:

Could not reach Cloud Firestore backend. Connection failed 1 times. Most recent error: FirebaseError: [code=unknown]: Fetching auth token failed: AppCheck: Fetch server returned an HTTP error status. HTTP status: 403. (appCheck/fetch-status-error).

And this one is printed from time to time:

Unhandled Promise rejection: cancelled ; Zone: <root> ; Task: Promise.then ; Value: cancelled undefined

In the firebase console under AppCheck API monitoring, all requests are marked as Unverified: outdated client requests

In the google recaptcha admin console, it says total requests 0.

The above happens on a deployed version of my app whose domain I have listed in the settings of the google recaptcha admin console.

What could be the issue? How do I debug it?

Jesper
  • 2,644
  • 4
  • 30
  • 65
  • Did you make any progress with this @Jesper? I have a very similar situation. – gillarf Jun 10 '22 at 11:37
  • It works now, but I'm not 100% sure what fixed it. I realised that the app I had deployed had the `production` flag set to `false`, so one of the things I tried was to set that to `true`. – Jesper Jun 11 '22 at 11:40

0 Answers0