4

I have setup Firebase AppCheck for my Web App and everything seemed to work fine. Now I would like to enable the debug mode when developing my app.

I followed the instructions in the official documentation but I keep getting random errors from the AppCheck module, and these prevent my app from accessing Firebase Storage:

...at Backend FirebaseError: AppCheck: Fetch server returned an HTTP error status. HTTP status: 429. (appCheck/fetch-status-error).

Following the doc, this is the way I set AppCheck in debug mode - this is ran before everything else:

if(window.location.hostname == "localhost")
  self.FIREBASE_APPCHECK_DEBUG_TOKEN = true;

Again, when my app is not in debug mode it works just fine.

Note 1: that I am not enforcing AppCheck via the console, and that 100% of the requests are displayed as "Verified"

enter image description here

Note 2: googling for "Firebase error 429" shows many results referring to some quota being exceeded, something hardly possible for my dev environment (we are 2 devs and definitely not putting in any sort of load on the app)

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
l1b3rty
  • 3,333
  • 14
  • 32

2 Answers2

1

Its a bug with the js library https://github.com/firebase/firebase-js-sdk/issues/5052

ebg11
  • 906
  • 1
  • 12
  • 33
-1

You should be using environment variables to detect debugging mode or not. Depending on your framework and setup, this could be a command that you set up in your serve/build commands or a local env file that contains a specific debug key.

There is another issue if your reCaptcha is set to use localhost as the documentation states:

Warning: Do not try to enable localhost debugging by adding localhost to reCAPTCHA’s allowed domains. Doing so would allow anyone to run your app from their local machines!

DIGI Byte
  • 4,225
  • 1
  • 12
  • 20