mirror of
https://github.com/bitwarden/browser
synced 2025-12-17 16:53:34 +00:00
migrate pin to use user's symmetric key instead of master key
- set up new state - migrate on lock component - use new crypto service methods
This commit is contained in:
@@ -7,6 +7,20 @@ describe("AccountSettings", () => {
|
||||
expect(AccountSettings.fromJSON(JSON.parse("{}"))).toBeInstanceOf(AccountSettings);
|
||||
});
|
||||
|
||||
it("should deserialize userSymKeyPin", () => {
|
||||
const accountSettings = new AccountSettings();
|
||||
accountSettings.userSymKeyPin = EncryptionPair.fromJSON<string, EncString>({
|
||||
encrypted: "encrypted",
|
||||
decrypted: "3.data",
|
||||
});
|
||||
const jsonObj = JSON.parse(JSON.stringify(accountSettings));
|
||||
const actual = AccountSettings.fromJSON(jsonObj);
|
||||
|
||||
expect(actual.userSymKeyPin).toBeInstanceOf(EncryptionPair);
|
||||
expect(actual.userSymKeyPin.encrypted).toEqual("encrypted");
|
||||
expect(actual.userSymKeyPin.decrypted.encryptedString).toEqual("3.data");
|
||||
});
|
||||
|
||||
it("should deserialize pinProtected", () => {
|
||||
const accountSettings = new AccountSettings();
|
||||
accountSettings.pinProtected = EncryptionPair.fromJSON<string, EncString>({
|
||||
|
||||
Reference in New Issue
Block a user