summaryrefslogtreecommitdiffhomepage
path: root/cloud/app/src/context/auth.withActor.ts
blob: a61b728ef2a65e0971ccfc7a6ecfec2fac783c4e (plain)
1
2
3
4
5
6
7
import { Actor } from "@opencode/cloud-core/actor.js"
import { getActor } from "./auth"

export async function withActor<T>(fn: () => T) {
  const actor = await getActor()
  return Actor.provide(actor.type, actor.properties, fn)
}