Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upLogin with github as backend fails if base url contains additional path segment #3622
Comments
Thanks @agairing, looks like origin contains the schema and port too: |
Ok, and I can try to create a PR. What about sth. like |
How about |
Fine for me. How should this be handled? At first glance, it seems that the test is not cross platform compatible. |
@agairing, thanks for letting us know. I opened an new issue for that #3655 and I'm surprised our CI doesn't fail it since it we run the tests on Widows too: https://github.com/netlify/netlify-cms/runs/609296943?check_suite_focus=true#step:6:1496. |
Describe the bug
If you use github as backend the following basic setup is required:
-create oauth app in github and configure callback url pointing to your github auth server backend (https://mygithub-auth-backend.org/callback)
--> This works well if the base url does not contain any path segment. This does not work if you use an additional path segment in your github auth server.
Example:
The authentication and token creation with github is successfull but the communication between the auth popup and the original page fails.
To Reproduce
Expected behavior
Login should work
Applicable Versions:
Additional context
It seems that the following check in netlify-auth.js is not working:
e.origin !== this.base_url
I think origin is always just the host without any path segment.