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:
@@ -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>;
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user