-
Notifications
You must be signed in to change notification settings - Fork 5.9k
Logout does not work behind reverse proxy #4503
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I think this will be similar to #4476 |
IssueWe realized after merging a fix there was an edge case. If you logout from a non-root path, it will not work. How to reproduceAsher outlined steps below to reproduce this issue locally. To do so, follow these steps:
ExpectedYou should be logged out and redirected to ActualYou are redirected to the root at http://localhost:8080 and not logged out. VideoScreen.Recording.2021-12-07.at.2.29.10.PM.movAdditional resources
See comment |
It appears to be working as expected - you are indeed brought to the right login page and you cannot access the editor Screen.Recording.2021-12-07.at.1.14.25.PM.mov@code-asher - I think we can close this then unless you want to try reproducing |
Update: we were missing a step in the reproduction. You need to logout from a non-root path. I will update the comment above. |
Updated by @jsjoeio
What's the problem I'm solving?
With the latest changes to use the upstream server in code-server, we're now running into issues with our reverse proxy not using the correct URL for the Log out functionality.. The specific code we're talking about lives here.
When using a reverse proxy (i.e. Caddy/NGINX), the /logout endpoint is incorrect because it has the wrong base path and protocol.
What are some ways to go about it?
The most ideal way to solve this is to use relative endpoints. This way, code-server doesn't care about the base path or protocol. It only knows and uses relative paths.
How will things change/what is the need for maintenance?
I am not sure if there is historical context I may be missing which would explain why we didn't use a relative path from the start (or rather why upstream didn't). Patching this in
vscode
means it's something we'll need to keep an eye on as we continue staying in line with upstream.I can't imagine this introducing any breaking changes but it could potentially break in specific environments if they don't support using relative paths for some reason 🤔 (though none specifically come to mind).
How to reproduce
Asher outlined steps below to reproduce this issue locally. To do so, follow these steps:
brew install caddy
)yarn watch
/code
with CaddyExpected
You are redirected to
http://mydomain.com/logout
Actual
You should be redirected to
http://mydomain.com/code/logout
Should be similar to the fix for this issue. See PR here.
The text was updated successfully, but these errors were encountered: