mirror of
https://github.com/bitwarden/browser
synced 2025-12-17 08:43:33 +00:00
set user symmetric key on lock component
- add missed key suffix types to crypto service methods
This commit is contained in:
@@ -18,10 +18,16 @@ export abstract class CryptoService {
|
||||
|
||||
setUserKey: (key: UserSymKey) => Promise<void>;
|
||||
getUserKeyFromMemory: (userId?: string) => Promise<UserSymKey>;
|
||||
getUserKeyFromStorage: (keySuffix: KeySuffixOptions, userId?: string) => Promise<UserSymKey>;
|
||||
getUserKeyFromStorage: (
|
||||
keySuffix: KeySuffixOptions.Auto | KeySuffixOptions.Biometric,
|
||||
userId?: string
|
||||
) => Promise<UserSymKey>;
|
||||
hasUserKey: () => Promise<boolean>;
|
||||
hasUserKeyInMemory: (userId?: string) => Promise<boolean>;
|
||||
hasUserKeyStored: (keySuffix?: KeySuffixOptions, userId?: string) => Promise<boolean>;
|
||||
hasUserKeyStored: (
|
||||
keySuffix?: KeySuffixOptions.Auto | KeySuffixOptions.Biometric,
|
||||
userId?: string
|
||||
) => Promise<boolean>;
|
||||
makeUserSymKey: (key: SymmetricCryptoKey) => Promise<[UserSymKey, EncString]>;
|
||||
clearUserKey: (clearSecretStorage?: boolean, userId?: string) => Promise<void>;
|
||||
setUserSymKeyMasterKey: (UserSymKeyMasterKey: string, userId?: string) => Promise<void>;
|
||||
|
||||
@@ -127,7 +127,10 @@ export class CryptoService implements CryptoServiceAbstraction {
|
||||
* @param userId The desired user
|
||||
* @returns True if the provided version of the user symmetric key is stored
|
||||
*/
|
||||
async hasUserKeyStored(keySuffix: KeySuffixOptions, userId?: string): Promise<boolean> {
|
||||
async hasUserKeyStored(
|
||||
keySuffix: KeySuffixOptions.Auto | KeySuffixOptions.Biometric,
|
||||
userId?: string
|
||||
): Promise<boolean> {
|
||||
switch (keySuffix) {
|
||||
case KeySuffixOptions.Auto:
|
||||
return (await this.stateService.getUserSymKeyAuto({ userId: userId })) != null;
|
||||
|
||||
Reference in New Issue
Block a user