fix: hide Admin UI if LNBITS_ADMIN_UI is false (#1537)

* fix: hide Admin config if `LNBITS_ADMIN_UI` is `false`

* chore: code format

* chore: code format
This commit is contained in:
Vlad Stan
2023-02-22 13:30:57 +01:00
committed by GitHub
parent f7e43cdd95
commit 12014ee3e3
3 changed files with 8 additions and 1 deletions
+3
View File
@@ -389,6 +389,9 @@ async def manifest(usr: str):
@core_html_routes.get("/admin", response_class=HTMLResponse)
async def index(request: Request, user: User = Depends(check_admin)):
if not settings.lnbits_admin_ui:
raise HTTPException(status_code=HTTPStatus.NOT_FOUND)
WALLET = get_wallet_class()
_, balance = await WALLET.status()