add trailing slash to currentUserUrl #5
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What are the relevant tickets?
Closes #4
Description (What does it do?)
This PR simply adds a trailing slash to the the API URL hitting
/apiv/0/users/me
to avoid a 301 redirection. 301 redirection breaks CORS requests, so this is necessary for the API request to not trigger a CORS error.How can this be tested?
mit-open
. Follow the instructions in themit-open
readme for initial setup. You will need an account in your local instance for this to work. Your instance ofmit-open
should be accessible athttp://od.odl.local:8063
. You will need to set the following environment variables:ocw-hugo-themes
(https://github.com/mitodl/ocw-hugo-themes) set up locally, running a course usingyarn start course
. Follow the readme there for basic setup instructions and make sure you can start up a course. After you have that working, check out thecg/add-mit-open-login-button
branch. Assuming you have cloned this repo, runyarn add /path/to/mit-open-login-button
to add your local copy of the code for this to your locally runningocw-hugo-themes
. This is necessary because the package is not yet published to NPM. You will also need an entry in yourhosts
file that points theocw.odl.local
domain to127.0.0.1
.mit-open
mit-open
Logged in as: username
with your username in place ofusername
mit-open