diff options
| author | Adam Soltys <[email protected]> | 2022-09-14 12:31:24 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2022-09-14 12:31:24 -0700 |
| commit | ed261ce59cae16c71868224455a4f8ca522d3212 (patch) | |
| tree | 4cb95d14ec9edb3f1cba7e3a59f3f42ece3022cd /routes/lnurl.js | |
| parent | aa6ce918b043f37bed35b6f5c3106e5251e626b7 (diff) | |
| parent | 59d7dcd4f97a63c2d572f41c908b342114701dc4 (diff) | |
| download | coinos-server-ed261ce59cae16c71868224455a4f8ca522d3212.tar.gz coinos-server-ed261ce59cae16c71868224455a4f8ca522d3212.zip | |
Merge branch 'master' into prod
Diffstat (limited to 'routes/lnurl.js')
| -rw-r--r-- | routes/lnurl.js | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/routes/lnurl.js b/routes/lnurl.js index e5f426a6..4335d566 100644 --- a/routes/lnurl.js +++ b/routes/lnurl.js @@ -15,7 +15,6 @@ import jwt from "jsonwebtoken"; import qs from "query-string"; import bolt11 from "bolt11"; - import { createInvoice, decodePaymentRequest, getPayments } from "lightning"; import { @@ -24,6 +23,7 @@ import { } from "./lightning/conversionFee.js"; import send from "$lib/send"; +import sendInternal from "$lib/sendInternal"; const logins = persist("data/logins.json"); const recipients = persist("data/recipients.json"); @@ -197,19 +197,14 @@ app.post("/pay", auth, async (req, res, next) => { lnurlPayments[secret] = user.id; if (recipients[secret]) { - url = `https://coinos.io/api/send`; - const { data } = await axios.post( - url, + let data = await sendInternal( { amount, memo: comment, username: recipients[secret].username }, - { - headers: { - authorization: req.headers.authorization - } - } + req.hostname, + user ); res.send(data); |
