From 48a9b7d70343557ee3c4a395c24e157e3947d258 Mon Sep 17 00:00:00 2001 From: Shane Melton Date: Mon, 10 Jul 2023 11:59:24 -0700 Subject: [PATCH] [PM-2647] Remove try/catch that was silencing error messages on incorrect passwords (#5662) --- .../delete-organization-dialog.component.ts | 29 +++++++++---------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/apps/web/src/app/admin-console/organizations/settings/components/delete-organization-dialog.component.ts b/apps/web/src/app/admin-console/organizations/settings/components/delete-organization-dialog.component.ts index df436e687e..f52115c268 100644 --- a/apps/web/src/app/admin-console/organizations/settings/components/delete-organization-dialog.component.ts +++ b/apps/web/src/app/admin-console/organizations/settings/components/delete-organization-dialog.component.ts @@ -9,7 +9,6 @@ import { OrganizationService } from "@bitwarden/common/admin-console/abstraction import { Organization } from "@bitwarden/common/admin-console/models/domain/organization"; import { UserVerificationService } from "@bitwarden/common/auth/abstractions/user-verification/user-verification.service.abstraction"; import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service"; -import { LogService } from "@bitwarden/common/platform/abstractions/log.service"; import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service"; import { Utils } from "@bitwarden/common/platform/misc/utils"; import { Verification } from "@bitwarden/common/types/verification"; @@ -36,10 +35,13 @@ class CountBasedLocalizationKey { class OrganizationContentSummaryItem { count: number; + get localizationKey(): string { return this.localizationKeyOptions.getKey(this.count); } + private localizationKeyOptions: CountBasedLocalizationKey; + constructor(count: number, localizationKeyOptions: CountBasedLocalizationKey) { this.count = count; this.localizationKeyOptions = localizationKeyOptions; @@ -88,7 +90,6 @@ export class DeleteOrganizationDialogComponent implements OnInit, OnDestroy { private i18nService: I18nService, private platformUtilsService: PlatformUtilsService, private userVerificationService: UserVerificationService, - private logService: LogService, private cipherService: CipherService, private organizationService: OrganizationService, private organizationApiService: OrganizationApiServiceAbstraction, @@ -116,20 +117,16 @@ export class DeleteOrganizationDialogComponent implements OnInit, OnDestroy { } protected submit = async () => { - try { - this.formPromise = this.userVerificationService - .buildRequest(this.formGroup.value.secret) - .then((request) => this.organizationApiService.delete(this.organization.id, request)); - await this.formPromise; - this.platformUtilsService.showToast( - "success", - this.i18nService.t("organizationDeleted"), - this.i18nService.t("organizationDeletedDesc") - ); - this.dialogRef.close(DeleteOrganizationDialogResult.Deleted); - } catch (e) { - this.logService.error(e); - } + await this.userVerificationService + .buildRequest(this.formGroup.value.secret) + .then((request) => this.organizationApiService.delete(this.organization.id, request)); + + this.platformUtilsService.showToast( + "success", + this.i18nService.t("organizationDeleted"), + this.i18nService.t("organizationDeletedDesc") + ); + this.dialogRef.close(DeleteOrganizationDialogResult.Deleted); }; private buildOrganizationContentSummary(ciphers: CipherView[]): OrganizationContentSummary {