diff --git a/apps/cli/src/commands/export.command.ts b/apps/cli/src/commands/export.command.ts index 4b36746309..50446d7e02 100644 --- a/apps/cli/src/commands/export.command.ts +++ b/apps/cli/src/commands/export.command.ts @@ -1,6 +1,5 @@ import * as program from "commander"; import * as inquirer from "inquirer"; -import { firstValueFrom } from "rxjs"; import { ExportFormat, ExportService } from "@bitwarden/common/abstractions/export.service"; import { PolicyService } from "@bitwarden/common/abstractions/policy/policy.service.abstraction"; @@ -16,9 +15,7 @@ export class ExportCommand { async run(options: program.OptionValues): Promise { if ( options.organizationid == null && - (await firstValueFrom( - this.policyService.policyAppliesToActiveUser$(PolicyType.DisablePersonalVaultExport) - )) + (await this.policyService.policyAppliesToUser(PolicyType.DisablePersonalVaultExport)) ) { return Response.badRequest( "One or more organization policies prevents you from exporting your personal vault." diff --git a/libs/common/src/services/passwordGeneration.service.ts b/libs/common/src/services/passwordGeneration.service.ts index 99964449d5..ca2c07a648 100644 --- a/libs/common/src/services/passwordGeneration.service.ts +++ b/libs/common/src/services/passwordGeneration.service.ts @@ -1,4 +1,3 @@ -import { firstValueFrom, map } from "rxjs"; import * as zxcvbn from "zxcvbn"; import { CryptoService } from "../abstractions/crypto.service"; @@ -11,7 +10,6 @@ import { EncString } from "../models/domain/enc-string"; import { GeneratedPasswordHistory } from "../models/domain/generated-password-history"; import { PasswordGeneratorOptions } from "../models/domain/password-generator-options"; import { PasswordGeneratorPolicyOptions } from "../models/domain/password-generator-policy-options"; -import { Policy } from "../models/domain/policy"; const DefaultOptions: PasswordGeneratorOptions = { length: 14, @@ -257,14 +255,7 @@ export class PasswordGenerationService implements PasswordGenerationServiceAbstr } async getPasswordGeneratorPolicyOptions(): Promise { - const policies: Policy[] = - this.policyService == null - ? null - : await firstValueFrom( - this.policyService.policies$.pipe( - map((p) => p.filter((policy) => policy.type === PolicyType.PasswordGenerator)) - ) - ); + const policies = await this.policyService?.getAll(PolicyType.PasswordGenerator); let enforcedOptions: PasswordGeneratorPolicyOptions = null; if (policies == null || policies.length === 0) {