[PM-2647] Remove try/catch that was silencing error messages on incorrect passwords (#5662)

This commit is contained in:
Shane Melton 2023-07-10 11:59:24 -07:00 committed by GitHub
parent da436317e3
commit 48a9b7d703
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 13 additions and 16 deletions

View File

@ -9,7 +9,6 @@ import { OrganizationService } from "@bitwarden/common/admin-console/abstraction
import { Organization } from "@bitwarden/common/admin-console/models/domain/organization"; import { Organization } from "@bitwarden/common/admin-console/models/domain/organization";
import { UserVerificationService } from "@bitwarden/common/auth/abstractions/user-verification/user-verification.service.abstraction"; import { UserVerificationService } from "@bitwarden/common/auth/abstractions/user-verification/user-verification.service.abstraction";
import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service"; 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 { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service";
import { Utils } from "@bitwarden/common/platform/misc/utils"; import { Utils } from "@bitwarden/common/platform/misc/utils";
import { Verification } from "@bitwarden/common/types/verification"; import { Verification } from "@bitwarden/common/types/verification";
@ -36,10 +35,13 @@ class CountBasedLocalizationKey {
class OrganizationContentSummaryItem { class OrganizationContentSummaryItem {
count: number; count: number;
get localizationKey(): string { get localizationKey(): string {
return this.localizationKeyOptions.getKey(this.count); return this.localizationKeyOptions.getKey(this.count);
} }
private localizationKeyOptions: CountBasedLocalizationKey; private localizationKeyOptions: CountBasedLocalizationKey;
constructor(count: number, localizationKeyOptions: CountBasedLocalizationKey) { constructor(count: number, localizationKeyOptions: CountBasedLocalizationKey) {
this.count = count; this.count = count;
this.localizationKeyOptions = localizationKeyOptions; this.localizationKeyOptions = localizationKeyOptions;
@ -88,7 +90,6 @@ export class DeleteOrganizationDialogComponent implements OnInit, OnDestroy {
private i18nService: I18nService, private i18nService: I18nService,
private platformUtilsService: PlatformUtilsService, private platformUtilsService: PlatformUtilsService,
private userVerificationService: UserVerificationService, private userVerificationService: UserVerificationService,
private logService: LogService,
private cipherService: CipherService, private cipherService: CipherService,
private organizationService: OrganizationService, private organizationService: OrganizationService,
private organizationApiService: OrganizationApiServiceAbstraction, private organizationApiService: OrganizationApiServiceAbstraction,
@ -116,20 +117,16 @@ export class DeleteOrganizationDialogComponent implements OnInit, OnDestroy {
} }
protected submit = async () => { protected submit = async () => {
try { await this.userVerificationService
this.formPromise = this.userVerificationService .buildRequest(this.formGroup.value.secret)
.buildRequest(this.formGroup.value.secret) .then((request) => this.organizationApiService.delete(this.organization.id, request));
.then((request) => this.organizationApiService.delete(this.organization.id, request));
await this.formPromise; this.platformUtilsService.showToast(
this.platformUtilsService.showToast( "success",
"success", this.i18nService.t("organizationDeleted"),
this.i18nService.t("organizationDeleted"), this.i18nService.t("organizationDeletedDesc")
this.i18nService.t("organizationDeletedDesc") );
); this.dialogRef.close(DeleteOrganizationDialogResult.Deleted);
this.dialogRef.close(DeleteOrganizationDialogResult.Deleted);
} catch (e) {
this.logService.error(e);
}
}; };
private buildOrganizationContentSummary(ciphers: CipherView[]): OrganizationContentSummary { private buildOrganizationContentSummary(ciphers: CipherView[]): OrganizationContentSummary {