Mark Suman
Mark Suman

Reputation: 10460

Firebase callable functions fail CORS redirect

I am following the "Call Functions from Your App" documenation for Firebase and am running into the following error:

Failed to load https://us-central1-(redacted).cloudfunctions.net/secondAddMessage: Response for preflight is invalid (redirect)

This is a react app hosted with Firebase Hosting using httpsCallable to call a Firebase Cloud Function. It's my understanding that CORS is configured automatically and that I don't need to do anything with it. However, this is failing on a redirect. Can't seem to find any documentation out there to explain this.

Anyone know why this is happening? Solutions?

Upvotes: 2

Views: 715

Answers (1)

Mark Suman
Mark Suman

Reputation: 10460

I figured it out. The firebase config on the react app had the wrong authDomain value. The web app was migrated from a different Firebase account, and the config info wasn't completely updated. Now that it has the correct authDomain, the CORS functionality is working.

Upvotes: 1

Related Questions