mirror of
https://github.com/bitwarden/server.git
synced 2025-07-01 16:12:49 -05:00
allow to disable user registration from env
This commit is contained in:
@ -206,6 +206,11 @@ namespace Bit.Core.Services
|
||||
|
||||
public async Task<IdentityResult> RegisterUserAsync(User user, string masterPassword)
|
||||
{
|
||||
if(_globalSettings.DisableUserRegistration)
|
||||
{
|
||||
throw new BadRequestException("Registration has been disabled by the system administrator.");
|
||||
}
|
||||
|
||||
var result = await base.CreateAsync(user, masterPassword);
|
||||
if(result == IdentityResult.Success)
|
||||
{
|
||||
|
Reference in New Issue
Block a user