From e7f3d977c4e1c2ed2c978e89c8adc2ad049d026e Mon Sep 17 00:00:00 2001 From: Vincent Salucci <26154748+vincentsalucci@users.noreply.github.com> Date: Fri, 2 Jul 2021 15:23:04 -0500 Subject: [PATCH] [Reset Password] BUG Add permission gate to key backfill (#1061) --- src/app/organizations/manage/people.component.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/app/organizations/manage/people.component.ts b/src/app/organizations/manage/people.component.ts index c99f018889..09b5fd02a6 100644 --- a/src/app/organizations/manage/people.component.ts +++ b/src/app/organizations/manage/people.component.ts @@ -114,9 +114,10 @@ export class PeopleComponent implements OnInit { this.canResetPassword = organization.canManageUsersPassword; this.orgUseResetPassword = organization.useResetPassword; this.callingUserType = organization.type; + this.orgHasKeys = organization.hasPublicAndPrivateKeys; // Backfill pub/priv key if necessary - if (!organization.hasPublicAndPrivateKeys) { + if (this.canResetPassword && !this.orgHasKeys) { const orgShareKey = await this.cryptoService.getOrgKey(this.organizationId); const orgKeys = await this.cryptoService.makeKeyPair(orgShareKey); const request = new OrganizationKeysRequest(orgKeys[0], orgKeys[1].encryptedString); @@ -127,8 +128,6 @@ export class PeopleComponent implements OnInit { } else { throw new Error(this.i18nService.t('resetPasswordOrgKeysError')); } - } else { - this.orgHasKeys = true; } await this.load();