CORS error from HTTPS website
Bug report
Describe the bug
Everything in my application works fine when running locally, but once I host the application using HTTPS, I cannot send Authentication requests to Supabase.
Access to XMLHttpRequest at 'https://DOMAIN.supabase.co//auth/v1/token?grant_type=password' from origin 'https://control.DOMAIN' 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.
Is there any parameter I need to add to the SupabaseJs instance to make this possible?
To Reproduce
- Creat Supabase online application
- Enable authentication
- Implement authentication inside of your application
- Host application using HTTPS
Expected behavior
Requests should work on HTTPS websites and not return a CORS error.
System information
- OS: [PopOS, Windows 11]
- Browser [Brave, Chrome]
- Version of supabase-js: [1.22.5]
- Version of Node.js: [e.g. 16.10.0]
Hi, this looks like an issue specific to your project. Please create an issue at https://app.supabase.io/support/new if you are still experiencing the issue
I had the same issue, check your environment variables, and compare them on local and server. In my case, I had put an extra letter in the VPS .env file, when I copied the key. So, when I was going to authenticate I got the cors error. It may be useful for someone