Ionic User calls fail and returns HTTP 400 error


#1

Hey guys,

I’m running into an issue where it seems that calls to the Ionic platform (specifically Ionic User) are returning HTTP 400 errors. I don’t recall this happening before, and calls fail in both the iOS simulator/device and in-browser, so I don’t think it’s Chrome’s CORS bug. I also haven’t touched any of the code that I use to call Ionic User, so I’m not really sure what’s going on. That end of things is pretty vanilla.

Here’s the error that Safari’s inspector returns:

[Error] Failed to load resource: the server responded with a status of 400 (BAD REQUEST) (identify, line 0), https://apps.ionic.io/api/v1/app/APP_ID/users/identify

Ionic User: – Error: Request Failed with status code of 400, ionic.io.bundle.min.js:2:6166

Chrome:

Ionic User: Error: CORS request rejected: https://apps.ionic.io/api/v1/app/APP_ID/users/identify(…)

XMLHttpRequest cannot load https://apps.ionic.io/api/v1/app/APP_ID/users/identify. Response to preflight request doesn't pass access control check: The 'Access-Control-Allow-Origin' header contains multiple values 'http://evil.com/, *', but only one is allowed. Origin 'http://localhost:8100' is therefore not allowed access.

This occurs upon any call to Ionic User, and depending on the situation it can cause the app to not load at all on-device. It also happens on all devices, in iOS simulator, and in the browser, and only whenever I call Ionic User’s save() method.

Any help would be appreciated. Thanks!!


#2

Hello @brewedandbattered, had this problem when I was trying to get the ID for the User of the Int type and must be String…


#3

@clistenes its true, for me it was the same, I changed my own id to string and now is working!