1
0
mirror of https://github.com/bitwarden/server.git synced 2025-06-30 15:42:48 -05:00

Fix bug preventing user from leaving org (#1721)

This commit is contained in:
Thomas Rittson
2021-11-18 21:15:22 +10:00
committed by GitHub
parent 9f96e4ce90
commit 2dc29e51d1
2 changed files with 39 additions and 6 deletions

View File

@ -385,9 +385,10 @@ namespace Bit.Api.Controllers
}
var ssoConfig = await _ssoConfigRepository.GetByOrganizationIdAsync(orgGuidId);
if (ssoConfig?.GetData()?.KeyConnectorEnabled == true)
if (ssoConfig?.GetData()?.KeyConnectorEnabled == true &&
_currentContext.User.UsesKeyConnector)
{
throw new BadRequestException("You cannot leave an Organization that is using Key Connector.");
throw new BadRequestException("You cannot leave this Organization because you are using its Key Connector.");
}
var userId = _userService.GetProperUserId(User);