mirror of
https://github.com/bitwarden/browser
synced 2025-12-20 10:13:31 +00:00
[PM-12047] Remove usage of ActiveUserState from cipher.service (#12814)
* Cipher service web changes * Updated browser client to pass user id to cipher service observable changes * Cli changes * desktop changes * Fixed test * Libs changes * Fixed merge conflicts * Fixed merge conflicts * removed duplicate reference fixed conflict * Fixed test * Fixed test * Fixed test * Fixed desturcturing issue on failed to decrypt ciphers cipher service * Updated abstraction to use method syntax * Fixed conflicts * Fixed test on add edit v2 Passed active userId to delete function * Used getUserId utility function * made vault changes * made suggestion changes * made suggestion changes * made suggestion changes * Replace getUserId function calls with pipe operator syntax for better consistency * fixed merge conflicts * revert mistake made of usinf account activity during merge conflict fix * fixed conflicts * fixed tests
This commit is contained in:
@@ -103,7 +103,7 @@ export class DefaultUserAsymmetricKeysRegenerationService
|
||||
}
|
||||
|
||||
// The private isn't decryptable, check to see if we can decrypt something with the userKey.
|
||||
const userKeyCanDecrypt = await this.userKeyCanDecrypt(userKey);
|
||||
const userKeyCanDecrypt = await this.userKeyCanDecrypt(userKey, userId);
|
||||
if (userKeyCanDecrypt) {
|
||||
this.logService.info(
|
||||
"[UserAsymmetricKeyRegeneration] User Asymmetric Key decryption failure detected, attempting regeneration.",
|
||||
@@ -155,8 +155,8 @@ export class DefaultUserAsymmetricKeysRegenerationService
|
||||
);
|
||||
}
|
||||
|
||||
private async userKeyCanDecrypt(userKey: UserKey): Promise<boolean> {
|
||||
const ciphers = await this.cipherService.getAll();
|
||||
private async userKeyCanDecrypt(userKey: UserKey, userId: UserId): Promise<boolean> {
|
||||
const ciphers = await this.cipherService.getAll(userId);
|
||||
const cipher = ciphers.find((cipher) => cipher.organizationId == null);
|
||||
|
||||
if (cipher != null) {
|
||||
|
||||
Reference in New Issue
Block a user