aboutsummaryrefslogtreecommitdiffstats
path: root/routes/lnurl.js
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2023-03-27 21:09:22 -0700
committerAdam Soltys <[email protected]>2023-03-27 21:09:22 -0700
commit0559a382066722b794e1aaaafbb24266c7302f9e (patch)
treeac390cb5f44f1d878f72760c89d8ee01f583e939 /routes/lnurl.js
parent5756d04533a69d93091dcbb469d83da6b55456bc (diff)
downloadcoinos-server-0559a382066722b794e1aaaafbb24266c7302f9e.tar.gz
coinos-server-0559a382066722b794e1aaaafbb24266c7302f9e.zip
strip spaces from usernames
Diffstat (limited to 'routes/lnurl.js')
-rw-r--r--routes/lnurl.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/routes/lnurl.js b/routes/lnurl.js
index cad209c5..97e4e8f8 100644
--- a/routes/lnurl.js
+++ b/routes/lnurl.js
@@ -1,6 +1,6 @@
import { g, s } from "$lib/db";
import { l, warn } from "$lib/logging";
-import { bail, fail } from "$lib/utils";
+import { bail, getUser, fail } from "$lib/utils";
import { v4 } from "uuid";
import got from "got";
import { generate } from "$lib/invoices";
@@ -42,7 +42,7 @@ export default {
},
async lnurlp({ params: { username } }, res) {
- let uid = await g(`user:${username.toLowerCase()}`);
+ let uid = await getUser(username);
if (!uid) {
let u = await got(`${classic}/admin/migrate/${username}?zero=true`, {
headers: { authorization: `Bearer ${admin}` },
@@ -56,7 +56,7 @@ export default {
u = { id: uid, about: u.address, ...pick(u, fields) };
delete u.address;
- await s(`user:${username.toLowerCase()}`, uid);
+ await s(`user:${username.replace(/\s/g, '').toLowerCase()}`, uid);
await s(`user:${uid}`, u);
await s(`balance:${uid}`, balance);