I have an application developed with React and Gatsby and deployed in Netlify. I've been facing the same issues with the tokens (expiring in 24 hours the most) and indeed I tried to re-generate new ones through the refresh token! According to the manual, a token is re-generated via a post request to https://idfed.constantcontact.com/as/token.oauth2 including the appropriate headers (grant_type and refresh_token). I am using axios api to make that call. The problem here is that when I post this request I am experiencing an error regarding CORS policy (Access to XMLHttpRequest at 'https://idfed.constantcontact.com/as/token.oauth2' from origin 'http://localhost:9000' 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.). The same error raises when I run it in production server and not only in localhost. I've tried many ways to resolve it but none worked. Do you have any idea how can I resolve it?
... View more