summaryrefslogtreecommitdiffhomepage
path: root/cloud/app/src/context/auth.withActor.ts
diff options
context:
space:
mode:
Diffstat (limited to 'cloud/app/src/context/auth.withActor.ts')
-rw-r--r--cloud/app/src/context/auth.withActor.ts7
1 files changed, 7 insertions, 0 deletions
diff --git a/cloud/app/src/context/auth.withActor.ts b/cloud/app/src/context/auth.withActor.ts
new file mode 100644
index 000000000..a61b728ef
--- /dev/null
+++ b/cloud/app/src/context/auth.withActor.ts
@@ -0,0 +1,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)
+}