12-03-2020 19:45
12-03-2020 19:45
Hello, I hope you can guide me in the right direction here since I've been pretty stuck. I am making a request from my react from end to my nodejs api and I am getting the following error. Any idea what's happening? Thanks!
Access to fetch at 'https://www.fitbit.com/oauth2/authorize?response_type=code&client_id=22C384&scope=activity%20heartra...' (redirected from 'http://localhost:5000/api/fitbit/authorize') 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. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
12-09-2020 16:44
Fitbit Developers oversee the SDK and API forums. We're here to answer questions about Fitbit developer tools, assist with projects, and make sure your voice is heard by the development team.
12-09-2020 16:44
Hi @alvarodltlp,
Welcome to the forums!
Are you attempting to authorize other users other than yourself? Or are you using this authorization URL for yourself for testing purposes? The reason I ask is the redirect URI you're using is fine for testing purposes, but wont work in a production environment. Localhost is not a URL that is external to the internet world that the public can access. You'll need to provide a valid redirect URI to your application to redirect your users back to after they grant consent to your application.
I hope this helps. Let me know if you continue to encounter this error after changing your redirect URI.
Best Answer01-28-2024 09:00
01-28-2024 09:00
I am facing the same cors issue and hasn't figure it out how to solve this.
Best Answer01-30-2024 13:15
Fitbit Developers oversee the SDK and API forums. We're here to answer questions about Fitbit developer tools, assist with projects, and make sure your voice is heard by the development team.
01-30-2024 13:15
@sajid Welcome to the forums!
Are you using localhost as your redirect url as well? Or are you using your IP address?
Best Answer