1
0
mirror of https://github.com/bitwarden/browser synced 2026-02-22 12:24:01 +00:00

Add clearing for the account cryptographic state

This commit is contained in:
Bernd Schoolmann
2026-01-07 13:16:31 +01:00
parent 18f027a578
commit 6b672f8cc3
3 changed files with 10 additions and 0 deletions

View File

@@ -19,4 +19,9 @@ export abstract class AccountCryptographicStateService {
accountCryptographicState: WrappedAccountCryptographicState,
userId: UserId,
): Promise<void>;
/**
* Clears the account cryptographic state.
*/
abstract clearAccountCryptographicState(userId: UserId): Promise<void>;
}

View File

@@ -32,4 +32,8 @@ export class DefaultAccountCryptographicStateService implements AccountCryptogra
userId,
);
}
async clearAccountCryptographicState(userId: UserId): Promise<void> {
await this.stateProvider.setUserState(ACCOUNT_CRYPTOGRAPHIC_STATE, null, userId);
}
}

View File

@@ -502,6 +502,7 @@ export class DefaultKeyService implements KeyServiceAbstraction {
await this.clearOrgKeys(userId);
await this.clearProviderKeys(userId);
await this.stateProvider.setUserState(USER_EVER_HAD_USER_KEY, null, userId);
await this.accountCryptographyStateService.clearAccountCryptographicState(userId);
}
// EFForg/OpenWireless