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:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user