fix(server): preserve v1 auth compatibility
This commit is contained in:
parent
43c08387f1
commit
fc7e4cf93e
3 changed files with 6 additions and 5 deletions
|
|
@ -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)
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue