mirror of
https://github.com/anomalyco/opencode.git
synced 2026-05-30 20:44:31 +00:00
fix(httpapi): add basic auth challenge for browser login
Adds a WWW-Authenticate challenge for unauthorized experimental HttpApi UI fallback responses so browsers open the Basic Auth prompt when a server password is configured.
This commit is contained in:
parent
8433e8b433
commit
101566131d
2 changed files with 8 additions and 1 deletions
|
|
@ -201,6 +201,7 @@ describe("HttpApi UI fallback", () => {
|
|||
const response = await uiApp({ password: "secret", username: "opencode" }).request("/")
|
||||
|
||||
expect(response.status).toBe(401)
|
||||
expect(response.headers.get("www-authenticate")).toBe('Basic realm="Secure Area"')
|
||||
})
|
||||
|
||||
test("accepts auth token for the web UI", async () => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue