@mcp-use/client 2.1.1-canary.4 → 2.1.1

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.
@@ -1456,12 +1456,10 @@ var HttpConnector = class extends BaseConnector {
1456
1456
  await transport.finishAuth(code, iss);
1457
1457
  }
1458
1458
  }).then(() => {
1459
- if (this.authorizationCache) {
1460
- this.authorizationCache = {
1461
- ...this.authorizationCache,
1462
- authenticated: true
1463
- };
1464
- }
1459
+ this.authorizationCache = {
1460
+ ...this.authorizationCache ?? { mode: "mixed" },
1461
+ authenticated: true
1462
+ };
1465
1463
  }).finally(() => {
1466
1464
  this.pendingOAuthCompletion = null;
1467
1465
  });
@@ -1492,7 +1490,12 @@ var HttpConnector = class extends BaseConnector {
1492
1490
  return this.authorizationCache;
1493
1491
  }
1494
1492
  if (this.authorizationDiscovery) return this.authorizationDiscovery;
1495
- this.authorizationDiscovery = this.discoverMixedAuthorization();
1493
+ this.authorizationDiscovery = this.discoverMixedAuthorization().then(
1494
+ (authorization) => {
1495
+ if (!authorization) this.authorizationDiscovery = null;
1496
+ return authorization;
1497
+ }
1498
+ );
1496
1499
  return this.authorizationDiscovery;
1497
1500
  }
1498
1501
  async discoverMixedAuthorization() {
@@ -1923,7 +1926,7 @@ var HttpConnector = class extends BaseConnector {
1923
1926
  };
1924
1927
 
1925
1928
  // src/utils/version.ts
1926
- var VERSION = "2.1.1-canary.4";
1929
+ var VERSION = "2.1.1";
1927
1930
  function getPackageVersion() {
1928
1931
  return VERSION;
1929
1932
  }
@@ -5896,7 +5899,13 @@ function useMcp(options) {
5896
5899
  }
5897
5900
  }
5898
5901
  if (authProviderRef.current) {
5899
- const tokens = await authProviderRef.current.tokens?.();
5902
+ let tokens;
5903
+ try {
5904
+ tokens = await authProviderRef.current.tokens?.();
5905
+ } catch (error2) {
5906
+ addLog("warn", "Failed to read OAuth tokens:", error2);
5907
+ tokens = void 0;
5908
+ }
5900
5909
  if (!isMountedRef.current) {
5901
5910
  addLog(
5902
5911
  "debug",