1
0
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:
Kyle Spearrin
2017-08-28 07:50:57 -04:00
parent 5fa7321575
commit 417ac64ad2
3 changed files with 9 additions and 2 deletions

View File

@ -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)
{