diff options
| author | Adam Soltys <[email protected]> | 2026-06-14 12:33:43 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2026-06-17 07:47:46 -0700 |
| commit | 7332e55641c21e024e50f83176b302df9c488e9a (patch) | |
| tree | 447bbc95d201bbb14d1bf4cdbb313f4aad9fd4c6 /index.ts | |
| parent | 85849ede6fb6bd9151703ebb8cf1b2b2df385b99 (diff) | |
| download | coinos-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.ts | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -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); |
