@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.js CHANGED
@@ -3569,16 +3569,17 @@ function formatWorkspaceChoices(wsList) {
3569
3569
  };
3570
3570
  });
3571
3571
  }
3572
- function buildClientOptions(config, store) {
3572
+ function buildClientOptions(config, store, email) {
3573
3573
  return {
3574
3574
  baseUrl: config.baseUrl,
3575
3575
  deploymentDomain: config.deploymentDomain,
3576
3576
  credentials: "omit",
3577
- sessionStorage: store?.getSessionStorageProvider?.()
3577
+ sessionStorage: store?.getSessionStorageProvider?.(),
3578
+ userEmail: email
3578
3579
  };
3579
3580
  }
3580
3581
  async function createAuthenticatedClient(config, creds, store) {
3581
- const arbi = createArbiClient(buildClientOptions(config, store));
3582
+ const arbi = createArbiClient(buildClientOptions(config, store, creds.email));
3582
3583
  await arbi.crypto.initSodium();
3583
3584
  const signingPrivateKey = base64ToBytes(creds.signingPrivateKeyBase64);
3584
3585
  const loginResult = await arbi.auth.loginWithKey({
@@ -3691,7 +3692,7 @@ async function resolveWorkspace(store, workspaceOpt) {
3691
3692
  throw new ArbiError("No workspace selected. Run: arbi workspace select <id>");
3692
3693
  }
3693
3694
  if (isCachedTokenValid(creds, workspaceId)) {
3694
- const arbi2 = createArbiClient(buildClientOptions(config, store));
3695
+ const arbi2 = createArbiClient(buildClientOptions(config, store, creds.email));
3695
3696
  await arbi2.crypto.initSodium();
3696
3697
  arbi2.session.setUser(creds.email);
3697
3698
  arbi2.session.setSelectedWorkspace(workspaceId);