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
+5
View File
@@ -35,6 +35,11 @@ class LNbitsSettings(BaseModel):
class UsersSettings(LNbitsSettings):
lnbits_admin_users: List[str] = Field(default=[])
lnbits_allowed_users: List[str] = Field(default=[])
lnbits_allow_new_accounts: bool = Field(default=True)
@property
def new_accounts_allowed(self) -> bool:
return self.lnbits_allow_new_accounts and len(self.lnbits_allowed_users) == 0
class ExtensionsSettings(LNbitsSettings):