1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-16 08:13:42 +00:00

Fix key rotation being broken due to org ciphers being included (#10140)

This commit is contained in:
Bernd Schoolmann
2024-07-17 16:31:35 +02:00
committed by GitHub
parent e27d698d4b
commit fd93c76c0d
2 changed files with 9 additions and 2 deletions

View File

@@ -1184,11 +1184,16 @@ export class CipherService implements CipherServiceAbstraction {
let encryptedCiphers: CipherWithIdRequest[] = [];
const ciphers = await this.getAllDecrypted();
if (!ciphers || ciphers.length === 0) {
if (!ciphers) {
return encryptedCiphers;
}
const userCiphers = ciphers.filter((c) => c.organizationId == null);
if (userCiphers.length === 0) {
return encryptedCiphers;
}
encryptedCiphers = await Promise.all(
ciphers.map(async (cipher) => {
userCiphers.map(async (cipher) => {
const encryptedCipher = await this.encrypt(cipher, newUserKey, originalUserKey);
return new CipherWithIdRequest(encryptedCipher);
}),