mirror of
https://github.com/bitwarden/browser
synced 2025-12-16 00:03:56 +00:00
[PM-23621] Require userId for initAccount on the key-service (#15684)
* require userID for initAccount on key service * add unit test coverage * update consumer
This commit is contained in:
@@ -386,11 +386,12 @@ export abstract class KeyService {
|
||||
/**
|
||||
* Initialize all necessary crypto keys needed for a new account.
|
||||
* Warning! This completely replaces any existing keys!
|
||||
* @param userId The user id of the target user.
|
||||
* @returns The user's newly created public key, private key, and encrypted private key
|
||||
*
|
||||
* @throws An error if there is no user currently active.
|
||||
* @throws An error if the userId is null or undefined.
|
||||
* @throws An error if the user already has a user key.
|
||||
*/
|
||||
abstract initAccount(): Promise<{
|
||||
abstract initAccount(userId: UserId): Promise<{
|
||||
userKey: UserKey;
|
||||
publicKey: string;
|
||||
privateKey: EncString;
|
||||
|
||||
Reference in New Issue
Block a user