CORS Warning: Create user without credentials (JS)


I am currently receiving an issue with CORS warning appearing. I am attempting to create a user without credentials using the example code gather from postman. Although it works within postman it does not work with the application itself.

I run the following code below.

var settings = {
“async”: true,
“crossDomain”: true,
“url”: “”,
“method”: “POST”,
“headers”: {
“Accept”: “application/json”,
“Content-Type”: “application/json”,
“Authorization”: “SSWS 00H7Kh1dMPOiwblhqtKkDzZVqHi-TmEpPTzzHo9DB1”,
“cache-control”: “no-cache”,
“Postman-Token”: “90268a46-9102-427e-b896-641eb1e4fad4”
“processData”: false,
“data”: “{\n “profile”: {\n \t"accountNo”: “1”,\n “firstName”: “Isaac”,\n “lastName”: “Brock”,\n “email”: "",\n “login”: "",\n “secondEmail”: ""\n }\n}"

$.ajax(settings).done(function (response) {

The expect error I should have got (printed into the console) was “login: An object with this field already exists in the current organization”;

However the console spits back an error from CORS.

Please ask any questions below if you need more information.

I found the solution. This was due to my trusted origin having ‘https://’ instead of ‘http://’ and an incorrect path to the jquery plugin.