diff options
| author | Frank <[email protected]> | 2025-10-20 16:17:49 -0400 |
|---|---|---|
| committer | Frank <[email protected]> | 2025-10-20 16:17:51 -0400 |
| commit | 075ef0fa34a6b5a423c1a1adc2eb546fab3f5212 (patch) | |
| tree | e7c6c81c263ed1bdf948081ef3eb55662a4ac624 /packages/function | |
| parent | 89b72e4442e4a4ce9379d95c96bd5ff29bb7ac6b (diff) | |
| download | opencode-075ef0fa34a6b5a423c1a1adc2eb546fab3f5212.tar.gz opencode-075ef0fa34a6b5a423c1a1adc2eb546fab3f5212.zip | |
wip: share
Diffstat (limited to 'packages/function')
| -rw-r--r-- | packages/function/src/api.ts | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/packages/function/src/api.ts b/packages/function/src/api.ts index 74ca22faf..572ac3cab 100644 --- a/packages/function/src/api.ts +++ b/packages/function/src/api.ts @@ -137,7 +137,11 @@ export default new Hono<{ Bindings: Env }>() return c.json({}) }) .post("/share_delete_admin", async (c) => { - const id = c.env.SYNC_SERVER.idFromName("oVF8Rsiv") + const body = await c.req.json<{ sessionShortName: string; adminSecret: string }>() + const sessionShortName = body.sessionShortName + const adminSecret = body.adminSecret + if (adminSecret !== Resource.ADMIN_SECRET.value) throw new Error("Invalid admin secret") + const id = c.env.SYNC_SERVER.idFromName(sessionShortName) const stub = c.env.SYNC_SERVER.get(id) await stub.clear() return c.json({}) |
