aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2024-12-06 09:01:11 -0800
committerAdam Soltys <[email protected]>2024-12-06 09:01:11 -0800
commitcd9ff85c3d17966c6866b1240b5e9a38b308f5ac (patch)
tree953de6207156212e39010df8b458ae1084fbf388
parentc90f58658b19e62facee6bd98c86a5363fed6841 (diff)
downloadcoinos-server-cd9ff85c3d17966c6866b1240b5e9a38b308f5ac.tar.gz
coinos-server-cd9ff85c3d17966c6866b1240b5e9a38b308f5ac.zip
sanitize lnurl username
-rw-r--r--routes/lnurl.ts4
1 files changed, 3 insertions, 1 deletions
diff --git a/routes/lnurl.ts b/routes/lnurl.ts
index 69f25ddb..8dcda8b2 100644
--- a/routes/lnurl.ts
+++ b/routes/lnurl.ts
@@ -53,7 +53,9 @@ export default {
query: { minSendable = 1000, maxSendable = 100000000000 },
} = req;
try {
- const { id: uid } = await getUser(username);
+ const { id: uid } = await getUser(
+ username.replace("lightning:", "").replace(/\s/, "").toLowerCase(),
+ );
const metadata = JSON.stringify([
["text/plain", `Paying ${username}@${host}`],