We load JS code by creating a script tag with dynamic src endpoint and append the script element into the page our src will call resource apex class (@RestResource)
I know that Community domain is different than the Apex Domain for that we need to add the Domain as Trust site and CORS
After Saleforce release we started to get an error
Access to XMLHttpRequest at 'https://XXXXXX/services/apexrest/FFNResource/v1/34OLM' from origin 'https://XXXX-developer-edition--live.XXX.force.com' has been blocked by CORS policy: The value of the 'Access-Control-Allow-Credentials' header in the response is 'false' which must be 'true' when the request's credentials mode is 'include'. The credentials mode of requests initiated by the XMLHttpRequest is controlled by the withCredentials attribute.
We added the header Access-Control-Allow-Credentials to true but that did not work we tried to added the script using ajex with dataType = 'Script' but that did not work it show the same error message
Community security setting: Security Level: Relaxed CSP Lightning Locker: ON Trusted Sites for Scripts: 1.https://XXX.force.com 2.https://live.XXX.force.com
I’m able to get 200 response request but not able to load JS into page after make a Request using Ajax with Text date type and withCredentials false
enter code here
The flow we are trying to accomplish is to load a dynamic JS script from a reset resource endpoint into Lightning Aura Component page
Q: Can we load a string script or load a dynamic script from Rest resource into a Lightning page?
Did you face this issue before please help!!