diff options
| -rw-r--r-- | .env.production | 1 | ||||
| -rw-r--r-- | src/routes/(app)/send/[...text]/+page.server.js | 4 |
2 files changed, 4 insertions, 1 deletions
diff --git a/.env.production b/.env.production index 4a2101df..c04aa886 100644 --- a/.env.production +++ b/.env.production @@ -2,3 +2,4 @@ PUBLIC_COINOS_URL=http://app:3119 PUBLIC_BTC=6f0279e9ed041c3d710a9f57d0c02928416460c4b722ae3457a11eec381c526d PUBLIC_SOCKET=wss://coinos.io/ws PUBLIC_EXPLORER=https://mempool.space +PUBLIC_DOMAIN=coinos.io 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}`); |
