refactor: checks

This commit is contained in:
Vlad Stan
2026-07-09 16:36:05 +03:00
parent 137498740a
commit 114229fb15
2 changed files with 9 additions and 11 deletions
+8 -10
View File
@@ -201,16 +201,14 @@ class ExtensionHostAPI:
from lnbits.core.models.payments import CreateInvoice
from lnbits.core.services.payments import create_payment_request
if self.user_id:
wallet = await get_wallet(request.wallet_id)
if wallet is None or wallet.user != self.user_id:
raise PermissionError(
"Creating an invoice for this wallet requires an "
"authenticated user context."
)
else:
pass
# todo: security stuff here
if not self.user_id:
raise PermissionError(
"Creating an invoice for this wallet requires an "
"authenticated user context."
)
wallet = await get_wallet(request.wallet_id)
if wallet is None or wallet.user != self.user_id:
raise PermissionError("Not your wallet.")
payment = await create_payment_request(
request.wallet_id,