How to Solve the Issue Where Firebase Hosting's Preview Channel Function Doesn't Work Due to Basic Authentication in Cloud Functions

Tadashi Shigeoka ·  Sat, January 15, 2022

I’ll share how I solved an issue where Firebase Hosting’s Preview channel function wasn’t working properly due to Basic authentication configured in Cloud Functions.

Firebase | ファイヤーベース

Background: Preview Environment Doesn't Work with Basic Authentication on Firebase Hosting

When setting up the Preview environment and Basic authentication on Firebase Hosting according to the past articles on this site below, there was an issue where old version content from public/* would be served.

Cause: Old Content Remains Hosted on `public/*`?

Since old content in public/* takes priority over functions/static/*, I thought I needed to do something about this.

Solution: Discontinue Basic Authentication in Cloud Functions

I was placing static files in functions/static/* solely to configure Basic authentication in Cloud Functions, but since the URLs issued by the Preview channel function are difficult to predict, I determined that Basic authentication wasn’t necessary and discontinued it.

That’s all from the Gemba about discontinuing Basic authentication to utilize Firebase Hosting’s Preview channel function.