From 7e3e87ed39ae012febcee8eec47261e406f34235 Mon Sep 17 00:00:00 2001 From: Thomas Rittson <31796059+eliykat@users.noreply.github.com> Date: Mon, 22 Nov 2021 08:22:28 +1000 Subject: [PATCH] Update error message for leaving org with CME (#1729) --- src/Api/Controllers/OrganizationsController.cs | 2 +- test/Api.Test/Controllers/OrganizationsControllerTests.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Api/Controllers/OrganizationsController.cs b/src/Api/Controllers/OrganizationsController.cs index e85f05343e..4434821c09 100644 --- a/src/Api/Controllers/OrganizationsController.cs +++ b/src/Api/Controllers/OrganizationsController.cs @@ -388,7 +388,7 @@ namespace Bit.Api.Controllers if (ssoConfig?.GetData()?.KeyConnectorEnabled == true && _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); diff --git a/test/Api.Test/Controllers/OrganizationsControllerTests.cs b/test/Api.Test/Controllers/OrganizationsControllerTests.cs index 6b69a7e971..480e475531 100644 --- a/test/Api.Test/Controllers/OrganizationsControllerTests.cs +++ b/test/Api.Test/Controllers/OrganizationsControllerTests.cs @@ -78,7 +78,7 @@ namespace Bit.Api.Test.Controllers var exception = await Assert.ThrowsAsync( () => _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); await _organizationService.DidNotReceiveWithAnyArgs().DeleteUserAsync(default, default);