[solved] Moralis and Firebase Auth extension gives CORS error

Hey all,

I tried setting up web authentication for firebase with the extension built by Moralis. I followed the tutorial here (https://www.youtube.com/watch?v=2HLxYYmZp94) and also in the docs, but I keep getting a CORS error. Metamask pops up as expected but console spits this out:

Access to fetch at ‘https://us-central1-newtest-7dd4f.cloudfunctions.net/ext-moralis-auth-requestMessage’ from origin ‘https://newtest-7dd4f.web.app’ has been blocked by CORS policy: Response to preflight request doesn’t pass access control check: No ‘Access-Control-Allow-Origin’ header is present on the requested resource. If an opaque response serves your needs, set the request’s mode to ‘no-cors’ to fetch the resource with CORS disabled.

How do I get past this?

1 Like

Does that url work? You can get that CORS error also when the server doesn’t respond

thank you!

You are right! It is not a CORS error at all. The problem is that it is not the right URL. The error references https://us-central1-newtest-7dd4f.cloudfunctions.net/ext-moralis-auth-requestMessage, but if you go to my google cloud functions my region is set to us-east4 so it should be https://us-east4-newtest-7dd4f.cloudfunctions.net/ext-moralis-auth-requestMessage

1 Like