node-oauth-example icon indicating copy to clipboard operation
node-oauth-example copied to clipboard

CORS issue, unable to fetch user details

Open saurabh-deep opened this issue 6 years ago • 1 comments

After successful authorization, it fails in welcome.html while trying to fetch user details using the user info API, due to CORS restrictions. I am receiving the following error. I tried using the cors module, but it didn't help. I am not sure how best to use it in this case.

Access to fetch at 'http://api.github.com/user' from origin 'http://localhost:8080' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: Redirect is not allowed for a preflight request.

saurabh-deep avatar Feb 05 '19 13:02 saurabh-deep

I think you have to use https instead of http.

chrisfromsoup avatar May 06 '19 20:05 chrisfromsoup