0

The lightning out(LO) app I have created worked fine. I did not use it however for a few months and now i get a 'Redirect is not allowed for a preflight request' error when my LWC tries to make an imperative apex call.

So the component loads fine using a guest user, then launches a flow and on one screen is a button that creates a case. This no longer worked and now returns:
Access to XMLHttpRequest at 'https://xyz.xyz.force.com/custom/aura?r=5&aura.ApexAction.execute=1' from origin 'https://xyz.github.io' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: Redirect is not allowed for a preflight request.

The site is added to the CORS and I dont think it can be the issue because the LO component loads and everything else works fine. I dont know if this is helpful but here is the payload in the request:

message: {"actions":[{"id":"139;a","descriptor":"aura://ApexActionController/ACTION$execute","callingDescriptor":"UNKNOWN","params":{"namespace":"","classname":"xyz","method":"makeCase","params":{"accountId":"xyz","assetId":"xyz","text":"Techniker termin Angefragt.\n            Das Problem ist in der vergangenen Woche wiederholt aufgetreten.\n            t","caseType":"demo"},"cacheable":false,"isContinuation":false}}]}
aura.context: {"mode":"PROD","fwuid":"xyz","app":"c:lightningOutTest","loaded":{"APPLICATION@markup://c:lightningOutTest":"60IRclI4h-s-B9Zp4Wwelw"},"dn":[],"globals":{},"uad":true}
aura.pageURI: /XYZ/XYZ.html

Any ideas would be very helpful.
Thank you

1 Answer 1

0

I was also getting a 301 Permanently Moved error in the dev console which made me curious and i found that a colleague had deleted the community site i was using.
What is really interesting to me is that despite using a non-existent url in the $Lightning.use method I was still able to access salesforce via lightning out and execute a flow, a flow that among other things executed database operations.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .