Skip to content

Logout Link is not working when using caddy #3608

Closed
@rdesaintleger

Description

@rdesaintleger

OS/Web Information

  • Web Browser: Firefox 89.0
  • Local OS: MacOS 11.3
  • Remote OS: Debian GNU/Linux 10 (buster)
  • Remote Architecture: amd64
  • code-server --version: 3.10.2 387b12e

Steps to Reproduce

  1. Perform a default VS Code exposed to the Internet using caddy. with the following caddy directive

your.ssl.domain/code/* {
uri strip_prefix /code
reverse_proxy 127.0.0.1:5080
}

  1. for the user which will run code-server, use the following configuration file

bind-addr: 127.0.0.1:5080
auth: password
password: secret
cert: false

  1. start the vscode service for the user and login
  2. try to logout

Expected

redirection to login page

Actual

code-server reopens

Logs

no logs from code-server. But a problem description

The logout request is done using an HTTP GET /code/logout?base=/code.

The 'base' parameter is sent using the query, however the logout service awaits the base parameter in the request body. The problem can be removed either by checking the base parameter in the query or using HTTP POST parameters when making the logout request.

https://github.com/cdr/code-server/blob/4bb7a8ddb9b75c6f99f44454a0217fbe6942824d/src/node/routes/logout.ts#L11

actually, changing 'body' to 'query' in the file /usr/lib/code-server/out/node/routes/logout.js and restarting code-server fixes the problem

Screenshot

none to be provided

Notes

This issue can be reproduced in VS Code: No

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions