1
0
mirror of https://github.com/bitwarden/server.git synced 2024-12-10 15:13:29 +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)
: IVerifyOrganizationDomainCommand
{
public async Task<OrganizationDomain> UserVerifyOrganizationDomainAsync(OrganizationDomain organizationDomain)
{
if (currentContext.UserId is null)
@ -53,7 +51,7 @@ public class VerifyOrganizationDomainCommand(
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);
@ -128,10 +126,8 @@ public class VerifyOrganizationDomainCommand(
{
if (featureService.IsEnabled(FeatureFlagKeys.AccountDeprovisioning))
{
await policyService.SaveAsync(
new Policy { OrganizationId = organizationId, Type = PolicyType.SingleOrg, Enabled = true },
savingUserId: actingUser is StandardUser standardUser ? standardUser.UserId : null,
eventSystemUser: actingUser is SystemUser systemUser ? systemUser.SystemUserType : null);
await EnableSingleOrganizationPolicyAsync(organizationId, actingUser);
await SendVerifiedDomainUserEmailAsync(organizationId);
}
}