rename token to auth token
parent
14042e2a56
commit
8515994094
|
|
@ -518,7 +518,7 @@ export const Terminal = (props: TerminalProps) => {
|
|||
const next = new URL(url + `/pty/${id}/connect`)
|
||||
next.searchParams.set("directory", directory)
|
||||
next.searchParams.set("cursor", String(seek))
|
||||
next.searchParams.set("token", btoa(`${username}:${password}`))
|
||||
next.searchParams.set("auth_token", btoa(`${username}:${password}`))
|
||||
next.protocol = next.protocol === "https:" ? "wss:" : "ws:"
|
||||
next.username = username
|
||||
next.password = password
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ export namespace Server {
|
|||
if (!password) return next()
|
||||
const username = Flag.OPENCODE_SERVER_USERNAME ?? "opencode"
|
||||
|
||||
if (c.req.query("token")) c.req.raw.headers.set("authorization", `Basic ${c.req.query("token")}`)
|
||||
if (c.req.query("auth_token")) c.req.raw.headers.set("authorization", `Basic ${c.req.query("auth_token")}`)
|
||||
|
||||
return basicAuth({ username, password })(c, next)
|
||||
})
|
||||
|
|
|
|||
Loading…
Reference in New Issue