Reputation: 6123
I'm using the Parse JS SDK. When I try to log in using
Parse.User.logIn(email, password, {
success: function(user) {
console.log('hi ' + user);
},
error: function(user, error) {
console.log(error);
}
});
My console outputs this error message:
XMLHttpRequest cannot load https://api.parse.com/1/login.
A wildcard '*' cannot be used in the 'Access-Control-Allow-Origin'
header when the credentials flag is true. Origin 'http://localhost:8080'
is therefore not allowed access.
It appears I'm facing the same problem as here: https://www.parse.com/questions/i-get-a-problem-of-access-control-allow-origin-when-i-was-using-rest-api but I'm using the javascript API.
Upvotes: 2
Views: 414
Reputation: 6123
I was using the Parse package available on nodejs and requiring it with webpack. When I switched over to the CDN, the problem no longer persisted. The code provided by the npm package and the CDN are almost exactly the same (npm package includes TODOS in comments). The problem is probably with webpack. I'm not sure how to fix it.
Upvotes: 1