@mitumba/sdk 5.17.0 → 5.17.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.
package/dist/index.mjs CHANGED
@@ -291,7 +291,13 @@ var APIClient = class {
291
291
  */
292
292
  async send(method, path, body, params, options) {
293
293
  if (!isSessionEndpoint(path)) {
294
- await this.ensureFreshToken(options);
294
+ try {
295
+ await this.ensureFreshToken(options);
296
+ } catch (error) {
297
+ if (!(error instanceof InvalidRefreshCredentialsError)) throw error;
298
+ this.config.onAuthExpired?.();
299
+ throw new APIError(401, { error: "session_expired", message: "Session expired. Please log in again." });
300
+ }
295
301
  }
296
302
  const url = new URL(path, this.config.baseUrl);
297
303
  if (params) {