diff options
| author | Adam Soltys <[email protected]> | 2023-04-20 13:33:20 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2023-04-20 13:33:20 -0700 |
| commit | 92c70d8350dab3de8e786bdad1c0a8f991cd8dbc (patch) | |
| tree | 6692072b29afd0f9f255152b2634bf711f47d62f /src | |
| parent | 4b82d5755b52979c11046b6328a95b7f52212f2c (diff) | |
| download | coinos-ui-92c70d8350dab3de8e786bdad1c0a8f991cd8dbc.tar.gz coinos-ui-92c70d8350dab3de8e786bdad1c0a8f991cd8dbc.zip | |
detect self LN address payments
Diffstat (limited to 'src')
| -rw-r--r-- | src/routes/(app)/send/[...text]/+page.server.js | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/routes/(app)/send/[...text]/+page.server.js b/src/routes/(app)/send/[...text]/+page.server.js index dbe2b660..513fa11e 100644 --- a/src/routes/(app)/send/[...text]/+page.server.js +++ b/src/routes/(app)/send/[...text]/+page.server.js @@ -2,11 +2,12 @@ import { validate } from 'bitcoin-address-validation'; import bip21 from 'bip21'; import { auth, get, post } from '$lib/utils'; import { fail, redirect } from '@sveltejs/kit'; +import { PUBLIC_DOMAIN } from '$env/static/public'; let parse = async (t, host) => { if (!t) return; - if (t.startsWith('http')) throw redirect(307, t); + if (t.startsWith('http')) throw redirect(307, t); let amount, user, id; @@ -17,6 +18,7 @@ let parse = async (t, host) => { options: { amount } } = bip21.decode(t)); + if (t.endsWith(`@${PUBLIC_DOMAIN}`)) t = t.split('@')[0]; if (t.includes('@') && t.includes('.')) { try { t = await get(`/encode?address=${t}`); |
