FirebaseExtended / action-hosting-deploy

Automatically deploy shareable previews for your Firebase Hosting sites
https://firebase.google.com/docs/hosting/github-integration
Apache License 2.0
695 stars 202 forks source link

[BUG] Deployed next.js function returns 'Your client does not have permission to get URL / from this server' #380

Open serpro69 opened 3 months ago

serpro69 commented 3 months ago

Action config

      - uses: FirebaseExtended/action-hosting-deploy@v0
        with:
          repoToken: ${{ secrets.GITHUB_TOKEN }}
          firebaseServiceAccount: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_FIREBASE_SANDBOX_425310 }}
          channelId: live
          projectId: firebase-sandbox-425310
        env:
          FIREBASE_CLI_EXPERIMENTS: webframeworks,pintags

Error message

We're deploying next.js to firebase hosting. After the site and function are deployed, opening the hosting url results in

403 Your client does not have permission to get URL / from this server

The logs say:

textPayload: "The request was not authenticated. Either allow unauthenticated invocations or set the proper Authorization header. Read more at https://cloud.google.com/run/docs/securing/authenticating Additional troubleshooting documentation can be found at: https://cloud.google.com/run/docs/troubleshooting#unauthorized-client"

I thought this should've been handled by firebase by default, since according to https://firebase.google.com/docs/hosting/functions:

Caution: New HTTP and HTTP callable functions deployed with any Firebase CLI lower than version 7.7.0 are private by default and throw HTTP 403 errors when invoked. Either explicitly make these functions public or update your Firebase CLI before you deploy any new functions.

However, that doesn't seem to be the case here.

Expected behavior

Deployed function should not be private

Actual behavior

403 because functions don't allow access