@vitalfit/sdk 0.2.8 → 0.2.9

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
@@ -130,13 +130,13 @@ var Client = class {
130
130
  const response = await import_axios.default.post(`${this.client.defaults.baseURL}/auth/refresh`, {
131
131
  refresh_token: this.refreshToken
132
132
  });
133
- const { access_token, refresh_token } = response.data;
134
- this.setTokens(access_token, refresh_token);
133
+ const { token, refresh_token } = response.data;
134
+ this.setTokens(token, refresh_token);
135
135
  if (this.onTokenUpdate) {
136
- this.onTokenUpdate(access_token, refresh_token);
136
+ this.onTokenUpdate(token, refresh_token);
137
137
  }
138
- this.processQueue(null, access_token);
139
- originalRequest.headers["Authorization"] = `Bearer ${access_token}`;
138
+ this.processQueue(null, token);
139
+ originalRequest.headers["Authorization"] = `Bearer ${token}`;
140
140
  return this.client(originalRequest);
141
141
  } catch (refreshError) {
142
142
  this.processQueue(refreshError, null);
@@ -152,7 +152,7 @@ var Client = class {
152
152
  );
153
153
  }
154
154
  async call(method, config) {
155
- const tokenToUse = this.accessToken || config.jwt;
155
+ const tokenToUse = config.jwt || this.accessToken;
156
156
  const axiosConfig = {
157
157
  method,
158
158
  url: config.url,
@@ -2369,7 +2369,7 @@ var VitalFit = class _VitalFit {
2369
2369
  return _VitalFit.instance;
2370
2370
  }
2371
2371
  version() {
2372
- return "0.2.8";
2372
+ return "0.2.9";
2373
2373
  }
2374
2374
  };
2375
2375
  // Annotate the CommonJS export names for ESM import in node: