mirror of
https://github.com/bitwarden/browser
synced 2026-02-27 01:53:23 +00:00
[PM-31763] Add unlock service & module (#18870)
* Add unlock service * Move methods * Prettier * Fix type errors * Prettier * Fix test * Fix module order * Attempt to fix tests * Cleanup CODEOWNERS * Backport biometric unlock and legacy master-key logic * Add tests for biometrics * Prettier * Add biometric unlock to abstract unlock service * Fix build
This commit is contained in:
@@ -45,10 +45,14 @@ export const MASTER_KEY = new UserKeyDefinition<MasterKey>(MASTER_PASSWORD_MEMOR
|
||||
});
|
||||
|
||||
/** Disk since master key hash is used for unlock */
|
||||
const MASTER_KEY_HASH = new UserKeyDefinition<string>(MASTER_PASSWORD_DISK, "masterKeyHash", {
|
||||
deserializer: (masterKeyHash) => masterKeyHash,
|
||||
clearOn: ["logout"],
|
||||
});
|
||||
export const MASTER_KEY_HASH = new UserKeyDefinition<string>(
|
||||
MASTER_PASSWORD_DISK,
|
||||
"masterKeyHash",
|
||||
{
|
||||
deserializer: (masterKeyHash) => masterKeyHash,
|
||||
clearOn: ["logout"],
|
||||
},
|
||||
);
|
||||
|
||||
/** Disk to persist through lock */
|
||||
export const MASTER_KEY_ENCRYPTED_USER_KEY = new UserKeyDefinition<EncryptedString>(
|
||||
|
||||
@@ -45,6 +45,14 @@ export class MasterPasswordUnlockData {
|
||||
);
|
||||
}
|
||||
|
||||
toSdk(): SdkMasterPasswordUnlockData {
|
||||
return {
|
||||
salt: this.salt,
|
||||
kdf: this.kdf.toSdkConfig(),
|
||||
masterKeyWrappedUserKey: this.masterKeyWrappedUserKey,
|
||||
};
|
||||
}
|
||||
|
||||
toJSON(): any {
|
||||
return {
|
||||
salt: this.salt,
|
||||
|
||||
Reference in New Issue
Block a user