1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-06 00:13:28 +00:00

fix: broken SDK interface (#14959)

This commit is contained in:
Andreas Coroiu
2025-05-27 14:31:27 +02:00
committed by GitHub
parent a6e2012087
commit 45f2104fd8
3 changed files with 16 additions and 6 deletions

View File

@@ -152,7 +152,15 @@ export class DefaultSdkService implements SdkService {
const settings = this.toSettings(env);
const client = await this.sdkClientFactory.createSdkClient(settings);
await this.initializeClient(client, account, kdfParams, privateKey, userKey, orgKeys);
await this.initializeClient(
userId,
client,
account,
kdfParams,
privateKey,
userKey,
orgKeys,
);
return client;
};
@@ -182,6 +190,7 @@ export class DefaultSdkService implements SdkService {
}
private async initializeClient(
userId: UserId,
client: BitwardenClient,
account: AccountInfo,
kdfParams: KdfConfig,
@@ -190,6 +199,7 @@ export class DefaultSdkService implements SdkService {
orgKeys: Record<OrganizationId, EncryptedOrganizationKeyData> | null,
) {
await client.crypto().initialize_user_crypto({
userId,
email: account.email,
method: { decryptedKey: { decrypted_user_key: userKey.keyB64 } },
kdfParams: