diff --git a/bitwarden_license/src/Scim/Users/PostUserCommand.cs b/bitwarden_license/src/Scim/Users/PostUserCommand.cs index 574221690c..ce26bf08be 100644 --- a/bitwarden_license/src/Scim/Users/PostUserCommand.cs +++ b/bitwarden_license/src/Scim/Users/PostUserCommand.cs @@ -102,16 +102,16 @@ public class PostUserCommand( var result = await inviteOrganizationUsersCommand.InviteScimOrganizationUserAsync(request); - var invitedUserId = result switch + var invitedOrganizationUserId = result switch { - Success success => success.Value.InvitedUser.OrganizationId, + Success success => success.Value.InvitedUser.Id, Failure { ErrorMessage: InviteOrganizationUsersCommand.NoUsersToInvite } => (Guid?)null, Failure failure when failure.ErrorMessages.Count != 0 => throw new BadRequestException(failure.ErrorMessage), _ => throw new InvalidOperationException() }; - var organizationUser = invitedUserId.HasValue - ? await organizationUserRepository.GetDetailsByIdAsync(invitedUserId.Value) + var organizationUser = invitedOrganizationUserId.HasValue + ? await organizationUserRepository.GetDetailsByIdAsync(invitedOrganizationUserId.Value) : null; return organizationUser;