add possibility to turn off new registrations (#2017)

with LNBITS_ALLOW_NEW_ACCOUNTS=false

while keeping existing users functional (i.e. no allowlist for existing users)
This commit is contained in:
Pavol Rusnak
2023-10-11 13:46:27 +02:00
committed by GitHub
parent b2384c10cc
commit ba0e431199
6 changed files with 20 additions and 6 deletions
+1 -1
View File
@@ -172,7 +172,7 @@ async def api_create_wallet(
@api_router.post("/api/v1/account", response_model=Wallet)
async def api_create_account(data: CreateWallet) -> Wallet:
if len(settings.lnbits_allowed_users) > 0:
if not settings.new_accounts_allowed:
raise HTTPException(
status_code=HTTPStatus.BAD_REQUEST,
detail="Account creation is disabled.",