From 7332e55641c21e024e50f83176b302df9c488e9a Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Sun, 14 Jun 2026 12:33:43 -0700 Subject: users: add authenticated self-delete endpoint Port of master 2548f757, adapted from Express to this stack's Hono handlers (c.get("user"), c.req.json(), setCookie, bail) and TigerBeetle balances (getBalance/getPending instead of the Redis balance:/pending: keys). POST /delete (auth) wipes every key tied to the calling user: user records, payments/invoices, sub-accounts, NWC apps, nostr follow graph + nip5. Gated by typing the username and refuses while balance+pending > 10k sats so funds can't be destroyed by accident. Co-Authored-By: Claude Opus 4.8 --- index.ts | 1 + 1 file changed, 1 insertion(+) (limited to 'index.ts') diff --git a/index.ts b/index.ts index bb944f41..83ac58e3 100644 --- a/index.ts +++ b/index.ts @@ -174,6 +174,7 @@ app.post("/register", users.create); app.post("/disable2fa", auth, users.disable2fa); app.post("/2fa", auth, users.enable2fa); app.post("/user", auth, users.update); +app.post("/delete", auth, users.deleteSelf); app.post("/reset", optional, users.reset); app.post("/upload/:type", users.upload); app.post("/acl", users.acl); -- cgit v1.2.3