CORS error (self-hosted)

Hi:

I’m getting a CORS policy error while trying to access my bases and can’t seem to find the config file to fix it.

My Seatable installation is hosted on a machine called https://a.b.com

But I want my users to access it from https://x.y.com (which points to a.b.com ip and has nginx configured properly).

I can access the logIn page and the dashboard, no problem, but once I click on a Base to open it, I get the following error:

Access to XMLHttpRequest at 'https://a.b.com/api/v2.1/dtables/21a8c0bc-9fb2-44c3-9716-01627053c785/related-users/' from origin 'https://x.y.com' 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.

The only place I’ve seen any kind of CORS policy config is in seatable/seatable-server-latest/dtable-server/dist/src/middleware/cors.js , but it looks alright (with ‘Access-Control-Allow-Origin’ *) and allowing all common methods.

Could anyone please help me find the place to change CORS policy for the api so it allows my x.y.com Origin?

Thanks in advance!

I’m not sure if this helps, but I’m posting it anyway:

When connecting to Seafile, which is also an external server, the Access-Control-Allow-Origin header has to be set:
Integrate with Seafile - SeaTable Admin Manual

The error I get, in case it helps to find an answer:
‘PreflightMissingAllowOriginHeader’

I still haven’t solved it, but I’m pretty certain it has to do with the related-users resource, as it seems to be the only API call that gets this CORS policy error.

I’ve checked http-service.js, which seems to be where that request is dealt with and I can’t find anything wrong.

Just keeping this thread open and updated in case anyone finds a way forward or helps uncover a bug (I’ve looked for it but haven’t found it)

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.