1
0
mirror of https://github.com/bitwarden/browser synced 2026-02-19 10:54:00 +00:00

Make set legacy state public

This commit is contained in:
Bernd Schoolmann
2026-01-12 19:23:55 +01:00
parent fcc2844a16
commit f200757d76
2 changed files with 12 additions and 1 deletions

View File

@@ -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<boolean>;
/**
* 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<void>;
}

View File

@@ -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,