r/opencodeCLI • u/JaMoLpE88 • Sep 27 '26
OpenCode web: infinite refresh loop with login form
It is impossible to access opencode web from mobile on lan, the login form goes into infinite refresh and you cannot fill out credentials.
Pair doesn't work either, it asks for credentials.
If you remove password from global variables it also asks for credentials.
It is impossible to access because it enters an infinite login refresh loop and cannot be filled.
Any solution?
1
Upvotes
1
u/YardNo1234 Sep 27 '26
This is a known OpenCode web issue: the app serves its JS/CSS assets with the
crossoriginattribute, and browsers send those as anonymous CORS requests that don't carry your HTTP Basic Auth credentials. So the HTML page authenticates fine, but every asset request comes back 401 and the browser re-prompts forever — which is exactly the infinite login loop you're seeing on mobile. It's being tracked upstream: https://github.com/anomalyco/opencode/issues/9206Two workarounds until it's fixed:
OPENCODE_SERVER_PASSWORDand restrict access at the network layer instead (bind to your LAN and keep it off the internet, or put it behind a reverse proxy that handles auth itself, e.g. a Tailscale serve or nginx basic-auth that forwards).Worth adding your environment details (version, iOS/Android, browser) to that GitHub issue so the fix gets prioritized.