@arbidocs/sdk 0.3.49 → 0.3.50

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/browser.cjs CHANGED
@@ -3572,16 +3572,17 @@ function formatWorkspaceChoices(wsList) {
3572
3572
  };
3573
3573
  });
3574
3574
  }
3575
- function buildClientOptions(config, store) {
3575
+ function buildClientOptions(config, store, email) {
3576
3576
  return {
3577
3577
  baseUrl: config.baseUrl,
3578
3578
  deploymentDomain: config.deploymentDomain,
3579
3579
  credentials: "omit",
3580
- sessionStorage: store?.getSessionStorageProvider?.()
3580
+ sessionStorage: store?.getSessionStorageProvider?.(),
3581
+ userEmail: email
3581
3582
  };
3582
3583
  }
3583
3584
  async function createAuthenticatedClient(config, creds, store) {
3584
- const arbi = client.createArbiClient(buildClientOptions(config, store));
3585
+ const arbi = client.createArbiClient(buildClientOptions(config, store, creds.email));
3585
3586
  await arbi.crypto.initSodium();
3586
3587
  const signingPrivateKey = client.base64ToBytes(creds.signingPrivateKeyBase64);
3587
3588
  const loginResult = await arbi.auth.loginWithKey({
@@ -3694,7 +3695,7 @@ async function resolveWorkspace(store, workspaceOpt) {
3694
3695
  throw new ArbiError("No workspace selected. Run: arbi workspace select <id>");
3695
3696
  }
3696
3697
  if (isCachedTokenValid(creds, workspaceId)) {
3697
- const arbi2 = client.createArbiClient(buildClientOptions(config, store));
3698
+ const arbi2 = client.createArbiClient(buildClientOptions(config, store, creds.email));
3698
3699
  await arbi2.crypto.initSodium();
3699
3700
  arbi2.session.setUser(creds.email);
3700
3701
  arbi2.session.setSelectedWorkspace(workspaceId);