Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Cross-origin resource sharing setting isn't applied #258
When I run an api call, I get this error:
In the Content Explorer, I navigated to Root/System/Settings/Portal.settings. In the settings, I added the next code to the bottom of the file:
I've also tried it with
How do I fix the error above, which I get when I try to reach the API with an external program?
I don't think the Angular call is the issue here, but just in case:
Angular api call:
Here is the error one more time:
This is an ajax call that is runned from the asp.net project on
I'm still a student, so I'll have to look into how I can host the Angular application on https instead of http. I'm going to pick that up now.
Is this a message aimed for me? I don't understand what your intent is. Do you want me to fix/document the sensenet bug/limitation? I'm not a native English speaker, so that might be the issue.
I'm very happy you are picking this up so quickly!
Some background information why I'm using Sensenet:
Just FYI: we have a sample TODO application for Angular that uses the new JWT login through our client sdk. The latest version of this sample app is not yet published to the main branch, but you can access it here:
I recommend that you check this out, because this is actually necessary for an Angular app to work. It takes care of managing the whole login process, sending headers etc. The old Login api will not work in a modern one-page app environment.
We've release a version that supports defining allowed domains with a port number. Please try it and verify that it solves the issue.