From 28661903b64c8206ad329164655e815cac570c92 Mon Sep 17 00:00:00 2001 From: calle <93376500+callebtc@users.noreply.github.com> Date: Sat, 13 Aug 2022 14:41:44 +0200 Subject: [PATCH] return http error UNAUTHORIZED instead of BAD_REQUEST if key is missing (#869) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * return http error UNAUTHORIZED instead of BAD_REQUEST if key is missing * fix regtest (#867) Co-authored-by: dni * return http error UNAUTHORIZED instead of BAD_REQUEST if key is missing Co-authored-by: dni ⚡ Co-authored-by: dni --- lnbits/core/views/api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lnbits/core/views/api.py b/lnbits/core/views/api.py index fbe5f100b..5a6d11404 100644 --- a/lnbits/core/views/api.py +++ b/lnbits/core/views/api.py @@ -270,7 +270,7 @@ async def api_payments_create( return await api_payments_create_invoice(invoiceData, wallet.wallet) else: raise HTTPException( - status_code=HTTPStatus.BAD_REQUEST, + status_code=HTTPStatus.UNAUTHORIZED, detail="Invoice (or Admin) key required.", )