fix: better differentiation between UNAUTHORIZED and FORBIDDEN (#3139)

This commit is contained in:
Vlad Stan
2025-05-05 10:55:58 +02:00
committed by GitHub
parent 6a9089fd98
commit 3529f9152f
7 changed files with 39 additions and 45 deletions
+2 -2
View File
@@ -155,7 +155,7 @@ async def api_payments_daily_stats(
if not user.admin:
exc = HTTPException(
status_code=HTTPStatus.UNAUTHORIZED,
status_code=HTTPStatus.FORBIDDEN,
detail="Missing wallet id.",
)
wallet_filter = next(
@@ -322,7 +322,7 @@ async def api_payments_create(
return await _api_payments_create_invoice(invoice_data, wallet.wallet)
else:
raise HTTPException(
status_code=HTTPStatus.UNAUTHORIZED,
status_code=HTTPStatus.FORBIDDEN,
detail="Invoice (or Admin) key required.",
)