Connecting to API is blocked by CORS policy

Hi, after I connected my previously working React app with KOR connect successfully, I get this message:

blocked by CORS policy: Response to preflight request doesn’t pass access control check: It does not have HTTP ok status.

I am certain this has to do with KOR connect. Is there a way to resolve this?
Or do I have no choice but to not use KOR connect and revert back?

I am using KOR connect to hide my API key in the frontend - my app has no backend.

I have been looking for several hours today for a potential solution, but none worked.

Would really appreciate your reply,

Thanks

Hi, this might be your browser blocking the connection, which it should but if you’re in development it’s easiest to unblock CORS temporarily. If you are using chrome try this extension, its the fastest way to try it out. Just remember to reactivate CORS afterwards. When you deploy it should work as its coming from the specified origin.

1 Like

I am facing a near identical issue to you. Did you ever get this resolved? If so how?

Hey, I ended up implementing a simple back end for the fetch, which should be the best practice. KOR CONNECT connects our app with a proxy server, so I thought it would not be blocked by CORS since it’s a proxy ‘server’. In short, I could not solve the issue using KOR CONNECT.

Or just like what jose says, it might work when you deploy the app, just not during development, which I have not tried out

Thank you for the explanation. At least I know now what is likely be a better method to use instead.