GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — auth_token query param bypasses auth for HTML but not for subresource loads (CSS/JS) · Issue #31484 · anomalyco/opencode

auth_token query param bypasses auth for HTML but not for subresource loads (CSS/JS) #31484

New issue
Copy link
New issue
Copy link
Closed as not planned
Closed as not planned
auth_token query param bypasses auth for HTML but not for subresource loads (CSS/JS)#31484
Copy link
Assignees
StarpTech

Description

@JoeyLearnsToCode
JoeyLearnsToCode
opened on Jun 9, 2026
Issue body actions

Description

When OPENCODE_SERVER_PASSWORD is set, accessing the web UI with ?auth_token=<base64> returns 200 for the initial HTML request, but the browser then fetches subresources (/assets/index-*.js, /assets/index-*.css, favicons) without the auth_token query param. The server's authorizationRouterMiddleware returns 401 with WWW-Authenticate: Basic for those subresource requests → the browser shows its native HTTP Basic Auth dialog, effectively breaking the auth_token flow.

Root cause: isPublicUIPath in packages/opencode/src/server/shared/public-ui.ts only exempts a few manifest paths from auth. The Vite build output under /assets/ and other static assets (favicons, etc.) are not exempt, so they trigger the auth challenge on every page load.

Expected: Page loads without auth prompt.
Actual: 200 for the HTML, but /assets/index-*.js and /assets/index-*.css return 401 → browser pops up the native Basic Auth dialog.

Attempted fix: Adding /assets/ prefix check and missing favicon/manifest paths to isPublicUIPath in public-ui.ts. However the issue persisted even after the server restart, suggesting there may be another auth layer or caching behavior involved.

Plugins

none

OpenCode version

1.16.2

Steps to reproduce

  1. Set OPENCODE_SERVER_PASSWORD=password123
  2. Run opencode web
  3. Open http://localhost:4096/?auth_token=<base64("opencode:password123")>

Screenshot and/or share link

No response

Operating System

Windows 11

Terminal

WT

Activity

  1. github-actions
    assigned
    StarpTech
    on Jun 9, 2026
  2. github-actions commented on Jun 9, 2026

    @github-actions
    github-actionsBot
    on Jun 9, 2026 – with GitHub Actions
    Contributor
    More actions

    This issue might be a duplicate of existing issues. Please check:

    • [Bug][Web] Basic auth causes 401 on /site.webmanifest and /global/event, then crashes with PasteTypeError #16493: Same root cause — Basic auth causes 401 on static subresources (/assets/, /site.webmanifest) when OPENCODE_SERVER_PASSWORD is set, because isPublicUIPath does not exempt those paths. Also reported on Windows with opencode web.
    • PWA manifest is not fetched with credentials behind authenticated proxy #30405: Related — PWA manifest not fetched with credentials when running behind an authenticated proxy (narrower scope, but same isPublicUIPath/credentials issue for subresources).

    If your issue is the same as one of these, please add a comment there instead so the fix can be tracked in one place.

  3. JoeyLearnsToCode commented on Jun 9, 2026

    @JoeyLearnsToCode
    JoeyLearnsToCode
    on Jun 9, 2026
    Author
    More actions

    It's not a same issue.

  4. shoootyou
    added 3 commits that reference this issue on Jun 9, 2026

    feat(server,app): replace Basic Auth dialog with custom login page

    d85a5cc
  5. github-actions commented on Aug 9, 2026

    @github-actions
    github-actionsBot
    on Aug 9, 2026 – with GitHub Actions
    Contributor
    More actions

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

  6. github-actions
    closed this as not plannedon Aug 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @StarpTech
    StarpTech

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.