mirror of
https://github.com/anomalyco/opencode.git
synced 2026-05-05 16:02:19 +00:00
wip: console
This commit is contained in:
parent
9ad4dc9296
commit
93f2805bc2
4 changed files with 8 additions and 11 deletions
|
|
@ -1,7 +1,7 @@
|
|||
import { useSession } from "vinxi/http"
|
||||
|
||||
export interface AuthSession {
|
||||
account: Record<
|
||||
account?: Record<
|
||||
string,
|
||||
{
|
||||
id: string
|
||||
|
|
|
|||
|
|
@ -20,13 +20,10 @@ export const getActor = async (): Promise<Actor.Info> => {
|
|||
if (!evt) throw new Error("No request event")
|
||||
const url = new URL(evt.request.headers.has("x-server-id") ? evt.request.headers.get("referer")! : evt.request.url)
|
||||
const auth = await useAuthSession()
|
||||
auth.data.account = auth.data.account ?? {}
|
||||
const splits = url.pathname.split("/").filter(Boolean)
|
||||
if (splits[0] !== "workspace") {
|
||||
// TODO
|
||||
console.log("before current")
|
||||
console.log(`current: ${auth.data.current}`)
|
||||
const current = auth.data.account[auth.data.current ?? ""]
|
||||
console.log("after current")
|
||||
if (current) {
|
||||
return {
|
||||
type: "account",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue