mirror of
https://github.com/bitwarden/browser
synced 2025-12-10 13:23:34 +00:00
@@ -97,6 +97,18 @@ describe("AddMasterPasswordUnlockData", () => {
|
|||||||
user_user1_kdfConfig_kdfConfig: { kdfType: 0, iterations: 600000 },
|
user_user1_kdfConfig_kdfConfig: { kdfType: 0, iterations: 600000 },
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it("handles users with missing global accounts", async () => {
|
||||||
|
const output = await runMigrator(sut, {
|
||||||
|
global_account_accounts: { user_user1: null },
|
||||||
|
user_user1_kdfConfig_kdfConfig: { kdfType: 0, iterations: 600000 },
|
||||||
|
});
|
||||||
|
|
||||||
|
expect(output).toEqual({
|
||||||
|
global_account_accounts: { user_user1: null },
|
||||||
|
user_user1_kdfConfig_kdfConfig: { kdfType: 0, iterations: 600000 },
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe("rollback", () => {
|
describe("rollback", () => {
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ type Account = {
|
|||||||
export class AddMasterPasswordUnlockData extends Migrator<72, 73> {
|
export class AddMasterPasswordUnlockData extends Migrator<72, 73> {
|
||||||
async migrate(helper: MigrationHelper): Promise<void> {
|
async migrate(helper: MigrationHelper): Promise<void> {
|
||||||
async function migrateAccount(userId: string, account: Account) {
|
async function migrateAccount(userId: string, account: Account) {
|
||||||
const email = account.email;
|
const email = account?.email;
|
||||||
const kdfConfig = await helper.getFromUser(userId, KDF_CONFIG_DISK);
|
const kdfConfig = await helper.getFromUser(userId, KDF_CONFIG_DISK);
|
||||||
const masterKeyEncryptedUserKey = await helper.getFromUser(
|
const masterKeyEncryptedUserKey = await helper.getFromUser(
|
||||||
userId,
|
userId,
|
||||||
|
|||||||
Reference in New Issue
Block a user