[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 { 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 {