aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2024-12-06 09:05:41 -0800
committerAdam Soltys <[email protected]>2024-12-06 09:05:41 -0800
commit8cc54b3fc00bc4ee4e1c37edab042ce4f972d5c5 (patch)
tree392bdfe32a8c53cf2c1a8aecf92c56efbe14282c
parentcd9ff85c3d17966c6866b1240b5e9a38b308f5ac (diff)
downloadcoinos-server-8cc54b3fc00bc4ee4e1c37edab042ce4f972d5c5.tar.gz
coinos-server-8cc54b3fc00bc4ee4e1c37edab042ce4f972d5c5.zip
better lnurl error
-rw-r--r--routes/lnurl.ts5
1 files changed, 4 insertions, 1 deletions
diff --git a/routes/lnurl.ts b/routes/lnurl.ts
index 8dcda8b2..1528d64c 100644
--- a/routes/lnurl.ts
+++ b/routes/lnurl.ts
@@ -53,10 +53,13 @@ export default {
query: { minSendable = 1000, maxSendable = 100000000000 },
} = req;
try {
- const { id: uid } = await getUser(
+ const user = await getUser(
username.replace("lightning:", "").replace(/\s/, "").toLowerCase(),
);
+ if (!user) fail(`User ${username} not found`);
+ const { id: uid } = user;
+
const metadata = JSON.stringify([
["text/plain", `Paying ${username}@${host}`],
["text/identifier", `${username}@${host}`],