aboutsummaryrefslogtreecommitdiffstats
path: root/index.ts
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-06-14 12:33:43 -0700
committerAdam Soltys <[email protected]>2026-06-17 07:47:46 -0700
commit7332e55641c21e024e50f83176b302df9c488e9a (patch)
tree447bbc95d201bbb14d1bf4cdbb313f4aad9fd4c6 /index.ts
parent85849ede6fb6bd9151703ebb8cf1b2b2df385b99 (diff)
downloadcoinos-server-7332e55641c21e024e50f83176b302df9c488e9a.tar.gz
coinos-server-7332e55641c21e024e50f83176b302df9c488e9a.zip
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 <[email protected]>
Diffstat (limited to 'index.ts')
-rw-r--r--index.ts1
1 files changed, 1 insertions, 0 deletions
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);