App Fails to Redirect After Sign-In and Shows Firestore 400 (Bad Request) Error in Debug Console

Integrations

My FlutterFlow app, currently in development, was working fine but recently stopped redirecting users after sign-in. Now, it only redirects to the logged-in screen after a page refresh in the Test Mode section. Additionally, Firestore data is not loading, and I'm seeing specific errors in the debug console.

Environment:

  • Platform: FlutterFlow

  • Authentication: Firebase Authentication

  • Database: Firebase Firestore

  • Error Messages:

    • webchannel_connection.ts:266 GET https://firestore.googleapis.com/google.firestore.v1.Firestore/Listen/channel?... net::ERR_ABORTED 400 (Bad Request)

    • webchannel_connection.ts:266 GET https://firestore.googleapis.com/google.firestore.v1.Firestore/Listen/... 400 (Bad Request)

Steps Taken:

  1. Verified that Firebase Authentication redirects to the correct page upon sign-in.

  2. Confirmed the app correctly loads the logged-in screen after a page refresh in Test Mode.

  3. Checked Firestore database rules and configurations to ensure correct permissions.

Symptoms:

  • Redirection: Users are not automatically redirected to the logged-in screen after signing in unless the page is refreshed.

  • Firestore Data: Firestore data does not load, and debug console shows 400 (Bad Request) errors from Firestore API requests.

Questions:

  1. Could the 400 (Bad Request) errors in the console indicate a misconfiguration in Firestore or an authentication issue?

  2. What could prevent automatic redirection after sign-in but still allow access upon page refresh?

  3. Are there any specific configurations or steps in FlutterFlow and Firebase that I should check to resolve these issues?

Additional Context: I recently made updates to my Firebase Firestore rules. Could this be affecting how Firestore data is loaded post-login?

What have you tried so far?

Steps Taken to Resolve:

  1. OAuth 2.0 Client ID: Deleted the automatically created web OAuth 2.0 Client ID in the Google Developer Console and created a new one, adding the following URIs to the Authorized JavaScript Origins and Authorized Redirect URIs:

    • https://app.flutterflow.io

    • https://ff-debug-service-frontend-free-ygxkweukma-uc.a.run.app

    • https://app.flutterflow.io/debug/__/auth/handler

    • https://ff-debug-service-frontend-free-ygxkweukma-uc.a.run.app/__/auth/handler

  2. User Permissions:

  3. Testing Results:

    • After implementing these steps, I still see the 400 (Bad Request) errors in the console for Firestore, and the app is not automatically redirecting users after sign-in. A manual refresh shows the logged-in screen but without Firestore data.

Did you check FlutterFlow's Documentation for this topic?
Yes
1
8 replies