1
0
mirror of https://github.com/bitwarden/server synced 2026-01-05 18:13:31 +00:00

Merge branch 'master' into feature/families-for-enterprise

This commit is contained in:
Justin Baur
2021-11-18 08:32:28 -05:00
59 changed files with 4250 additions and 129 deletions

View File

@@ -384,6 +384,13 @@ namespace Bit.Api.Controllers
throw new NotFoundException();
}
var ssoConfig = await _ssoConfigRepository.GetByOrganizationIdAsync(orgGuidId);
if (ssoConfig?.GetData()?.KeyConnectorEnabled == true &&
_currentContext.User.UsesKeyConnector)
{
throw new BadRequestException("You cannot leave this Organization because you are using its Key Connector.");
}
var userId = _userService.GetProperUserId(User);
await _organizationService.DeleteUserAsync(orgGuidId, userId.Value);
}
@@ -642,7 +649,7 @@ namespace Bit.Api.Controllers
var ssoConfig = await _ssoConfigRepository.GetByOrganizationIdAsync(id);
ssoConfig = ssoConfig == null ? model.ToSsoConfig(id) : model.ToSsoConfig(ssoConfig);
await _ssoConfigService.SaveAsync(ssoConfig);
await _ssoConfigService.SaveAsync(ssoConfig, organization);
return new OrganizationSsoResponseModel(organization, _globalSettings, ssoConfig);
}