adrien2p / medusa-plugins

A collection of awesome plugins for medusa :rocket:
https://medusa-plugins.vercel.app
MIT License
144 stars 42 forks source link

Cors Issue in Production, Firebase Auth #153

Closed kevinrobert3 closed 3 months ago

kevinrobert3 commented 3 months ago

Everything works perfectly in localhost but on deploying to vercel, we get cors error Screenshot 2024-03-23 at 01 55 54 This is our staging subdomain e.g staging.plugin.com, our preview urls also have the same cors error. We have added the regex for vercel.app and our subdomain to store cors. This (/admin/auth/firebase) is the only api that has the cors error

kevinrobert3 commented 3 months ago

I have managed to fix it in the staging subdomain. But all .vercel.app urls have the cors error. This is my ADMIN_CORS const ADMIN_CORS=http://localhost:7000,http://localhost:7001,http://localhost:3000,https://staging.plugin.com,/vercel\\.app$/;

adrien2p commented 3 months ago

Have you checked if it is part of the domain public list? Cause those domains will never pass if they are part of the list for security reasons, otherwise anybody with a public domain could access yours

adrien2p commented 3 months ago

Any news?

kevinrobert3 commented 3 months ago

Hello Adrien, welcome back, I managed to fix this i.e the admin/auth/firebase route. I can close this issue now.

Outside of this issue, can you take a quick glance at this issue https://github.com/medusajs/medusa/issues/6809 if in your core focus at Medusa and maybe shed light. It is a cors error issue but affecting certain routes only. It is quite bizarre and I was told it is a misconfiguration.