@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/index.cjs CHANGED
@@ -5896,7 +5896,10 @@ var SignalWire = class extends Destroyable {
5896
5896
  throw new require_operators.InvalidCredentialsError("Provided credentials have expired.");
5897
5897
  }
5898
5898
  if (_credentials.expiry_at && credentialProvider.refresh) {
5899
- const refreshFn = credentialProvider.refresh;
5899
+ const refreshFn = async () => {
5900
+ if (!credentialProvider.refresh) throw new require_operators.InvalidCredentialsError("Credential provider does not support refresh");
5901
+ return credentialProvider.refresh();
5902
+ };
5900
5903
  const refreshInterval = Math.max(_credentials.expiry_at - Date.now() - 5e3, 1e3);
5901
5904
  this._refreshTimerId = setTimeout(async () => {
5902
5905
  try {