mirror of
https://github.com/bitwarden/browser
synced 2025-12-15 15:53:27 +00:00
[PM-21797] Require userID for keyService's getUserKeyFromStorage (#14855)
* require userID for keyService's getUserKeyFromStorage
This commit is contained in:
@@ -178,11 +178,10 @@ export class DefaultKeyService implements KeyServiceAbstraction {
|
||||
|
||||
async getUserKeyFromStorage(
|
||||
keySuffix: KeySuffixOptions,
|
||||
userId?: UserId,
|
||||
userId: UserId,
|
||||
): Promise<UserKey | null> {
|
||||
userId ??= await firstValueFrom(this.stateProvider.activeUserId$);
|
||||
if (userId == null) {
|
||||
throw new Error("No active user id found.");
|
||||
throw new Error("UserId is required");
|
||||
}
|
||||
|
||||
const userKey = await this.getKeyFromStorage(keySuffix, userId);
|
||||
|
||||
Reference in New Issue
Block a user