@signalwire/js 4.0.0-beta.5 → 4.0.0-beta.7

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.mjs CHANGED
@@ -16310,7 +16310,10 @@ var SignalWire = class extends Destroyable {
16310
16310
  throw new InvalidCredentialsError("Provided credentials have expired.");
16311
16311
  }
16312
16312
  if (_credentials.expiry_at && credentialProvider.refresh) {
16313
- const refreshFn = credentialProvider.refresh;
16313
+ const refreshFn = async () => {
16314
+ if (!credentialProvider.refresh) throw new InvalidCredentialsError("Credential provider does not support refresh");
16315
+ return credentialProvider.refresh();
16316
+ };
16314
16317
  const refreshInterval = Math.max(_credentials.expiry_at - Date.now() - 5e3, 1e3);
16315
16318
  this._refreshTimerId = setTimeout(async () => {
16316
16319
  try {