diff --git a/libs/common/src/key-management/master-password/abstractions/master-password-unlock.service.ts b/libs/common/src/key-management/master-password/abstractions/master-password-unlock.service.ts index 63ee7d69719..24e43683930 100644 --- a/libs/common/src/key-management/master-password/abstractions/master-password-unlock.service.ts +++ b/libs/common/src/key-management/master-password/abstractions/master-password-unlock.service.ts @@ -1,6 +1,7 @@ import { UserId } from "@bitwarden/user-core"; import { UserKey } from "../../../types/key"; +import { MasterPasswordUnlockData } from "../types/master-password.types"; export abstract class MasterPasswordUnlockService { /** @@ -24,4 +25,14 @@ export abstract class MasterPasswordUnlockService { * @returns true if the userKey can be decrypted, false otherwise. */ abstract proofOfDecryption(masterPassword: string, userId: UserId): Promise; + + /** + * Previously unlocking had the side effect of setting the masterKey and masterPasswordHash in state. + * This is to preserve that behavior, once masterKey and masterPasswordHash state is removed this should be removed as well. + */ + abstract setLegacyState( + masterPassword: string, + masterPasswordUnlockData: MasterPasswordUnlockData, + userId: UserId, + ): Promise; } diff --git a/libs/common/src/key-management/master-password/services/default-master-password-unlock.service.ts b/libs/common/src/key-management/master-password/services/default-master-password-unlock.service.ts index 89a87403e49..e00fd1ee5e6 100644 --- a/libs/common/src/key-management/master-password/services/default-master-password-unlock.service.ts +++ b/libs/common/src/key-management/master-password/services/default-master-password-unlock.service.ts @@ -88,7 +88,7 @@ export class DefaultMasterPasswordUnlockService implements MasterPasswordUnlockS // Previously unlocking had the side effect of setting the masterKey and masterPasswordHash in state. // This is to preserve that behavior, once masterKey and masterPasswordHash state is removed this should be removed as well. - private async setLegacyState( + async setLegacyState( masterPassword: string, masterPasswordUnlockData: MasterPasswordUnlockData, userId: UserId,