aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/invoices.js4
-rw-r--r--lib/upload.js1
2 files changed, 4 insertions, 1 deletions
diff --git a/lib/invoices.js b/lib/invoices.js
index f17223aa..814e87d9 100644
--- a/lib/invoices.js
+++ b/lib/invoices.js
@@ -12,9 +12,11 @@ import ln from "$lib/ln";
export let generate = async ({ invoice, user, sender }) => {
let { currency, tip, amount, rate, request_id, type } = invoice;
+ amount = parseInt(amount);
+ tip = parseInt(tip || 0);
+
if (amount < 0) fail("amount out of range");
if (tip > 5 * amount || tip < 0) fail("tip amount out of range");
- tip = tip || 0;
if (!user) user = sender;
let uid = await g(`user:${user.username}`);
diff --git a/lib/upload.js b/lib/upload.js
index 5f5aebed..2f8180a0 100644
--- a/lib/upload.js
+++ b/lib/upload.js
@@ -12,6 +12,7 @@ export default async (req, res) => {
params: { type },
user
} = req;
+ console.log("TYPE", type)
if (!["banner", "profile"].includes(type)) throw new Error("invalid upload");
let data = await req.file();