Skip to content

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

Description

@thdxg

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingwebRelates to opencode on web / desktop

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions