Asana / node-asana

Official node.js and browser JS client for the Asana API v1
MIT License
264 stars 74 forks source link

CORS request rejected v0.13.0 on accessing Projects #105

Open saiy2k opened 8 years ago

saiy2k commented 8 years ago

Hi,

Getting the following error on accessing workspaces, "Only for some users".

asana.js:4776 Unhandled rejection Error: CORS request rejected: https://app.asana.com/api/1.0/workspaces?limit=50 at on_response (http://176.9.35.233:8080/asana/asana.js:8971:22) at XMLHttpRequest.on_state_change (http://176.9.35.233:8080/asana/asana.js:8954:7)

Browser: Chrome 46 (Incognito mode with No extension)

With one user, everything works just fine and the workspaces, tasks are being pulled. But with another user, CORS rejection always happen.

screen shot 2015-11-24 at 9

slobak commented 8 years ago

Thanks for reporting this issue. I'm having difficulty reproducing this, and also wondering why CORS has anything to do with which user would be involved. But hey, strange things happen.

Can you provide some more detail about the differences between the users? Are you using the same authentication mechanism for each? Is it Oauth, API Key, or Personal Access Token? Does one of them have more than 50 workspaces somehow, so the request you're making ends up paginating? Is the request always served from javascript inside a page served on that origin (your IP and port)?

Note, this is a public forum, so please don't put any personal or confidential information (including user IDs) in your response. If you end up needing to provide us data to help debug this, we should communicate via api-support@asana.com.

saiy2k commented 8 years ago

Hi,

Thanks for the response :+1:

Tried this fix @ https://gist.github.com/agnoster/6e38a1c595102e892381 (Though, It seems outdated)

My App is hosted @ http://176.9.35.233/asana/index.html

The code is very simple and the core logic lies in http://176.9.35.233/asana/logic.js

I will get more details from the user, who is having the issue and revert here.