jaredhanson / passport-github

GitHub authentication strategy for Passport and Node.js.
https://www.passportjs.org/packages/passport-github/?utm_source=github&utm_medium=referral&utm_campaign=passport-github&utm_content=about
MIT License
535 stars 290 forks source link

Nodejs Passportjs Reactjs CORS issue #73

Open noman-ih opened 5 years ago

noman-ih commented 5 years ago

Dear All I am using github login for my react.js application with passport github2 strategy My React.js app is running on port 3000 and the Node.js server is running on port 5000

This is error I am getting when I try to login with github, please see the screenshot

image

Access to XMLHttpRequest at 'https://github.com/login/oauth/authorize?response_type=code&redirect_uri=http%3A%2F%2FXX.XX.71.24%3A5000%2Fapi%2Fv1%2Fauth%2Fgithub%2Fcallback&scope=user%3Aemail&client_id=f34f1df531540449d402' (redirected from 'http://XX.XX.71.24:3000/api/v1/auth/github') from origin 'http://XX.XX.71.24:3000' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

CORS is enabled on my server as other endpoints are working fine Here is the CORS settings

image

this my github app setting

image

Adri1985 commented 1 year ago

same issue