mirror of
https://github.com/bitwarden/browser
synced 2025-12-18 09:13:33 +00:00
[PM-7604] Require target UserID for KdfConfigService (#14380)
* Require userId for KdfConfigService * Update auth team callers * Update tools team callers
This commit is contained in:
@@ -37,14 +37,14 @@ export class DefaultKdfConfigService implements KdfConfigService {
|
||||
await this.stateProvider.setUserState(KDF_CONFIG, kdfConfig, userId);
|
||||
}
|
||||
|
||||
async getKdfConfig(): Promise<KdfConfig> {
|
||||
const userId = await firstValueFrom(this.stateProvider.activeUserId$);
|
||||
async getKdfConfig(userId: UserId): Promise<KdfConfig> {
|
||||
if (userId == null) {
|
||||
throw new Error("KdfConfig can only be retrieved when there is active user");
|
||||
throw new Error("userId cannot be null");
|
||||
}
|
||||
|
||||
const state = await firstValueFrom(this.stateProvider.getUser(userId, KDF_CONFIG).state$);
|
||||
if (state == null) {
|
||||
throw new Error("KdfConfig for active user account state is null");
|
||||
throw new Error("KdfConfig for user " + userId + " is null");
|
||||
}
|
||||
return state;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user