mirror of
https://github.com/bitwarden/browser.git
synced 2024-12-28 17:27:50 +01:00
[Reset Password] BUG Add permission gate to key backfill (#1061)
This commit is contained in:
parent
b304783a7f
commit
e7f3d977c4
@ -114,9 +114,10 @@ export class PeopleComponent implements OnInit {
|
|||||||
this.canResetPassword = organization.canManageUsersPassword;
|
this.canResetPassword = organization.canManageUsersPassword;
|
||||||
this.orgUseResetPassword = organization.useResetPassword;
|
this.orgUseResetPassword = organization.useResetPassword;
|
||||||
this.callingUserType = organization.type;
|
this.callingUserType = organization.type;
|
||||||
|
this.orgHasKeys = organization.hasPublicAndPrivateKeys;
|
||||||
|
|
||||||
// Backfill pub/priv key if necessary
|
// Backfill pub/priv key if necessary
|
||||||
if (!organization.hasPublicAndPrivateKeys) {
|
if (this.canResetPassword && !this.orgHasKeys) {
|
||||||
const orgShareKey = await this.cryptoService.getOrgKey(this.organizationId);
|
const orgShareKey = await this.cryptoService.getOrgKey(this.organizationId);
|
||||||
const orgKeys = await this.cryptoService.makeKeyPair(orgShareKey);
|
const orgKeys = await this.cryptoService.makeKeyPair(orgShareKey);
|
||||||
const request = new OrganizationKeysRequest(orgKeys[0], orgKeys[1].encryptedString);
|
const request = new OrganizationKeysRequest(orgKeys[0], orgKeys[1].encryptedString);
|
||||||
@ -127,8 +128,6 @@ export class PeopleComponent implements OnInit {
|
|||||||
} else {
|
} else {
|
||||||
throw new Error(this.i18nService.t('resetPasswordOrgKeysError'));
|
throw new Error(this.i18nService.t('resetPasswordOrgKeysError'));
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
this.orgHasKeys = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
await this.load();
|
await this.load();
|
||||||
|
Loading…
Reference in New Issue
Block a user