aboutsummaryrefslogtreecommitdiffstats
path: root/routes/payments.js
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2023-02-06 16:42:02 -0800
committerAdam Soltys <[email protected]>2023-02-06 16:42:02 -0800
commit6f5602d112b68adb7452abf3047f20c32e7725b6 (patch)
tree640903158751d97954cec7b8687f1aa88079305f /routes/payments.js
parentf4c51cddc3d6c45fa1de5fd928b1b2a0f95774f8 (diff)
downloadcoinos-server-6f5602d112b68adb7452abf3047f20c32e7725b6.tar.gz
coinos-server-6f5602d112b68adb7452abf3047f20c32e7725b6.zip
auth middleware for disable2fa
Diffstat (limited to 'routes/payments.js')
-rw-r--r--routes/payments.js12
1 files changed, 6 insertions, 6 deletions
diff --git a/routes/payments.js b/routes/payments.js
index 37f4c953..1043959c 100644
--- a/routes/payments.js
+++ b/routes/payments.js
@@ -240,19 +240,19 @@ export default {
res.send({ txid });
},
- async del({ params: { username }, headers: { authorization }}, res) {
-if (!authorization.includes(config.admin)) return res.code(401).send("unauthorized")
+ async del({ params: { username }, headers: { authorization } }, res) {
+ if (!authorization.includes(config.admin))
+ return res.code(401).send("unauthorized");
let { id, pubkey } = await g(`user:${await g(`user:${username}`)}`);
let invoices = await db.lRange(`${id}:invoices`, 0, -1);
let payments = await db.lRange(`${id}:payments`, 0, -1);
- for (let {id} of invoices) db.del(`invoice:${id}`);
- for (let {id} of payments) db.del(`payment:${id}`);
+ for (let { id } of invoices) db.del(`invoice:${id}`);
+ for (let { id } of payments) db.del(`payment:${id}`);
db.del(`user:${username}`);
db.del(`user:${id}`);
db.del(`user:${pubkey}`);
res.send({});
- }
+ }
};
-