-
Notifications
You must be signed in to change notification settings - Fork 794
Closed
Description
Following the guide posted on Square's Developer documentation. I can run the Node OAuth 2 sample from here: (https://github.com/square/connect-api-examples/tree/master/connect-examples/oauth/node) just fine locally with the Sandbox. But when I try to run a similar setup in a local React app, the obtainToken method from the square-connect Node library throws the following error:
Refused to set unsafe header "User-Agent"
Access to XMLHttpRequest at 'https://connect.squareupsandbox.com/oauth2/token' from origin 'http://localhost:3000' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.
client.js:772 POST https://connect.squareupsandbox.com/oauth2/token net::ERR_FAILED
Not sure how to overcome the CORS policy here. Could I get some assistance please?
Metadata
Metadata
Assignees
Labels
No labels