Skip to content

Conversation

lpatmo
Copy link
Member

@lpatmo lpatmo commented Mar 8, 2020

If I have the django and react app running at the same time on localhost:8000 and localhost:3000 respectively, I get a cors error if I try to make requests to localhost:8000/auth/users from the React app:

image

This PR whitelists http://localhost:3000 to prevent the cors error.

@billglover billglover self-requested a review March 8, 2020 21:20
@billglover billglover added the bug Something isn't working label Mar 8, 2020
Copy link
Contributor

@billglover billglover left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How do we guarantee that users run the React app on port 3000. If this is a standard, or this is documented somewhere as part for the React app guidelines, then this looks good to me.

@lpatmo
Copy link
Member Author

lpatmo commented Mar 9, 2020

How do we guarantee that users run the React app on port 3000

Heh, good question. The default is 3000, but folks can definitely specify alternate ports. I'll make sure to document on the React side. Thanks for reviewing!

@lpatmo lpatmo merged commit bb78dd1 into master Mar 9, 2020
@billglover billglover deleted the unblock-cors-react branch March 9, 2020 10:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants