diff options
| -rw-r--r-- | routes/payments.ts | 2 | ||||
| -rw-r--r-- | routes/users.ts | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/routes/payments.ts b/routes/payments.ts index 665e0014..3e59fb0f 100644 --- a/routes/payments.ts +++ b/routes/payments.ts @@ -239,7 +239,7 @@ export default { callback: `${URL}/api/lnurlw`, k1: name, defaultDescription: `Withdraw from coinos fund ${name}`, - minWithdrawable: balance * 1000, + minWithdrawable: balance > 0 ? 1000 : 0, maxWithdrawable: balance * 1000, }); }, diff --git a/routes/users.ts b/routes/users.ts index 87797cce..3f453141 100644 --- a/routes/users.ts +++ b/routes/users.ts @@ -371,6 +371,8 @@ export default { fail("Invalid signature or challenge mismatch."); let user = await getUser(event.pubkey); + if (!user) fail("Pubkey not found"); + const { username } = user; l("logging in", username, req.headers["cf-connecting-ip"]); |
