fix(server): preserve v1 auth compatibility

This commit is contained in:
Dax Raad 2026-07-20 21:46:23 -04:00
commit fc7e4cf93e
3 changed files with 6 additions and 5 deletions

View file

@ -3,7 +3,7 @@ import { ServerAuth } from "@opencode-ai/server/auth"
import { Option, Redacted } from "effect"
test("accepts only the fixed opencode username", () => {
const config = { password: Option.some("secret") }
const config = { password: Option.some("secret"), username: "opencode" }
expect(ServerAuth.authorized({ username: "opencode", password: Redacted.make("secret") }, config)).toBe(true)
expect(ServerAuth.authorized({ username: "custom", password: Redacted.make("secret") }, config)).toBe(false)
})