1
0
mirror of https://github.com/bitwarden/server.git synced 2024-12-03 14:03:33 +01:00

bringing changes from nc user changes.

This commit is contained in:
jrmccannon 2024-11-15 14:13:15 -06:00
parent 68cdc343ea
commit eb79696dfb
No known key found for this signature in database
GPG Key ID: CF03F3DB01CE96A6

View File

@ -28,8 +28,6 @@ public class VerifyOrganizationDomainCommand(
ILogger<VerifyOrganizationDomainCommand> logger) ILogger<VerifyOrganizationDomainCommand> logger)
: IVerifyOrganizationDomainCommand : IVerifyOrganizationDomainCommand
{ {
public async Task<OrganizationDomain> UserVerifyOrganizationDomainAsync(OrganizationDomain organizationDomain) public async Task<OrganizationDomain> UserVerifyOrganizationDomainAsync(OrganizationDomain organizationDomain)
{ {
if (currentContext.UserId is null) if (currentContext.UserId is null)
@ -53,7 +51,7 @@ public class VerifyOrganizationDomainCommand(
return domainVerificationResult; return domainVerificationResult;
} }
public async Task<OrganizationDomain> SystemVerifyOrganizationDomainAsync(OrganizationDomain organizationDomain) // need request object to hold who is doing the action public async Task<OrganizationDomain> SystemVerifyOrganizationDomainAsync(OrganizationDomain organizationDomain)
{ {
var actingUser = new SystemUser(EventSystemUser.DomainVerification); var actingUser = new SystemUser(EventSystemUser.DomainVerification);
@ -128,10 +126,8 @@ public class VerifyOrganizationDomainCommand(
{ {
if (featureService.IsEnabled(FeatureFlagKeys.AccountDeprovisioning)) if (featureService.IsEnabled(FeatureFlagKeys.AccountDeprovisioning))
{ {
await policyService.SaveAsync( await EnableSingleOrganizationPolicyAsync(organizationId, actingUser);
new Policy { OrganizationId = organizationId, Type = PolicyType.SingleOrg, Enabled = true }, await SendVerifiedDomainUserEmailAsync(organizationId);
savingUserId: actingUser is StandardUser standardUser ? standardUser.UserId : null,
eventSystemUser: actingUser is SystemUser systemUser ? systemUser.SystemUserType : null);
} }
} }