django_react_socialauth
django_react_socialauth copied to clipboard
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://apis.google.com/_/scs/apps-static/_/js/k=oz.gapi.en_US.sazTpAB7NWc.O/m=auth2/rt=j/sv=1/d=1/ed=1/am=wQE/rs=AGLTcCMGRnMhese6OTxesnN0rDvhruAGIg/cb=gapi.loaded_0. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing).
How do i solve this issue?
Can you describe what led to this issue?
the social auth token for google works perfectly when implemented in django via templates. but when implemented it via react frontend it gave this error. i guess in settings.py of django we have corsheaders mentioned. but is there any way to whitelist domains in react so that this Cross-Origin Request Blocked: error can be resolved.
Did you try to clone and run the repo?
I dont actually remember I cloned or directly downloaded. Whats the difference bw these two. any advantages by cloning?
No that is the same thing in this context I mean that won't cause this issue. I am not sure why this issue is caused, Did you check you entered the correct domain name in the Google developers website?
I guess there might be some issues of cors. I'll try that again by following your blog. If the same issue crops up ill share whole code details and also full error details.
I have the same problem , react running on localhost:3000 and django localhost:8000 despite of CORS Allow header , the server reject the api call.
in settings.py I have the below lines already and added crosheaders to INSTALLED_APPS and MIDDLEWARE
ALLOWED_HOSTS = []
CORS_ORIGIN_ALLOW_ALL = True
Had a similar problem when using react-google-drive-picker, when I run the UI on port 3000 everything runs smoothly. However when serving static files via port 8000 and django, the google picker popup gets blocked