opencode icon indicating copy to clipboard operation
opencode copied to clipboard

Failing to authenticate into web UI when username or password is set

Open thdxg opened this issue 1 day ago • 1 comments

Description

I set the environment variables OPENCODE_SERVER_USERNAME and OPENCODE_SERVER_PASSWORD, and then started a web UI using the opencode web command. However, when I open the server URL on browser, the authentication dialog keeps opening up even when I put correct username and password.

The server logs just say failed, and the subsequent run of opencode fails with an error saying Unauthorized.

If I unset the environment variables, opencode works again.

Plugins

No response

OpenCode version

1.1.21

Steps to reproduce

  1. Set OPENCODE_SERVER_USERNAME and OPENCODE_SERVER_PASSWORD environment variables
  2. Run opencode web --> cannot authenticate with the correct username and password
  3. Run opencode --> fails with an error Unauthorized
  4. Unset OPENCODE_SERVER_USERNAME and OPENCODE_SERVER_PASSWORD
  5. opencode works again

Screenshot and/or share link

Image

Operating System

macOS 26.3

Terminal

Ghostty

thdxg avatar Jan 17 '26 10:01 thdxg