mirror of
https://github.com/bitwarden/server.git
synced 2025-05-20 11:04:31 -05:00
Update error message for leaving org with CME (#1729)
This commit is contained in:
parent
33edc8eba0
commit
7e3e87ed39
@ -388,7 +388,7 @@ namespace Bit.Api.Controllers
|
|||||||
if (ssoConfig?.GetData()?.KeyConnectorEnabled == true &&
|
if (ssoConfig?.GetData()?.KeyConnectorEnabled == true &&
|
||||||
_currentContext.User.UsesKeyConnector)
|
_currentContext.User.UsesKeyConnector)
|
||||||
{
|
{
|
||||||
throw new BadRequestException("You cannot leave this Organization because you are using its Key Connector.");
|
throw new BadRequestException("Your organization's Single Sign-On settings prevent you from leaving.");
|
||||||
}
|
}
|
||||||
|
|
||||||
var userId = _userService.GetProperUserId(User);
|
var userId = _userService.GetProperUserId(User);
|
||||||
|
@ -78,7 +78,7 @@ namespace Bit.Api.Test.Controllers
|
|||||||
var exception = await Assert.ThrowsAsync<BadRequestException>(
|
var exception = await Assert.ThrowsAsync<BadRequestException>(
|
||||||
() => _sut.Leave(orgId.ToString()));
|
() => _sut.Leave(orgId.ToString()));
|
||||||
|
|
||||||
Assert.Contains("You cannot leave this Organization because you are using its Key Connector.",
|
Assert.Contains("Your organization's Single Sign-On settings prevent you from leaving.",
|
||||||
exception.Message);
|
exception.Message);
|
||||||
|
|
||||||
await _organizationService.DidNotReceiveWithAnyArgs().DeleteUserAsync(default, default);
|
await _organizationService.DidNotReceiveWithAnyArgs().DeleteUserAsync(default, default);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user