mirror of
https://github.com/bitwarden/browser.git
synced 2024-11-22 11:45:59 +01:00
[PS-1051] Fix/add master pass hash to all org reset key requests (#3049)
* clarify master password reset calls * Add master password hash to master password change requests
This commit is contained in:
parent
4dd149e912
commit
12615c203f
@ -120,6 +120,7 @@ export class OrganizationOptionsComponent {
|
||||
},
|
||||
});
|
||||
} else {
|
||||
// Remove reset password
|
||||
const request = new OrganizationUserResetPasswordEnrollmentRequest();
|
||||
request.masterPasswordHash = "ignored";
|
||||
request.resetPasswordKey = null;
|
||||
|
@ -224,7 +224,7 @@ export class ChangePasswordComponent extends BaseChangePasswordComponent {
|
||||
|
||||
await this.updateEmergencyAccesses(encKey[0]);
|
||||
|
||||
await this.updateAllResetPasswordKeys(encKey[0]);
|
||||
await this.updateAllResetPasswordKeys(encKey[0], masterPasswordHash);
|
||||
}
|
||||
|
||||
private async updateEmergencyAccesses(encKey: SymmetricCryptoKey) {
|
||||
@ -252,7 +252,7 @@ export class ChangePasswordComponent extends BaseChangePasswordComponent {
|
||||
}
|
||||
}
|
||||
|
||||
private async updateAllResetPasswordKeys(encKey: SymmetricCryptoKey) {
|
||||
private async updateAllResetPasswordKeys(encKey: SymmetricCryptoKey, masterPasswordHash: string) {
|
||||
const orgs = await this.organizationService.getAll();
|
||||
|
||||
for (const org of orgs) {
|
||||
@ -270,6 +270,7 @@ export class ChangePasswordComponent extends BaseChangePasswordComponent {
|
||||
|
||||
// Create/Execute request
|
||||
const request = new OrganizationUserResetPasswordEnrollmentRequest();
|
||||
request.masterPasswordHash = masterPasswordHash;
|
||||
request.resetPasswordKey = encryptedKey.encryptedString;
|
||||
|
||||
await this.apiService.putOrganizationUserResetPasswordEnrollment(org.id, org.userId, request);
|
||||
|
@ -128,6 +128,7 @@ export class SetPasswordComponent extends BaseChangePasswordComponent {
|
||||
);
|
||||
|
||||
const resetRequest = new OrganizationUserResetPasswordEnrollmentRequest();
|
||||
resetRequest.masterPasswordHash = masterPasswordHash;
|
||||
resetRequest.resetPasswordKey = encryptedKey.encryptedString;
|
||||
|
||||
return this.apiService.putOrganizationUserResetPasswordEnrollment(
|
||||
|
Loading…
Reference in New Issue
Block a user