@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 +7 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +7 -7
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
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 {
|
|
134
|
-
this.setTokens(
|
|
133
|
+
const { token, refresh_token } = response.data;
|
|
134
|
+
this.setTokens(token, refresh_token);
|
|
135
135
|
if (this.onTokenUpdate) {
|
|
136
|
-
this.onTokenUpdate(
|
|
136
|
+
this.onTokenUpdate(token, refresh_token);
|
|
137
137
|
}
|
|
138
|
-
this.processQueue(null,
|
|
139
|
-
originalRequest.headers["Authorization"] = `Bearer ${
|
|
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 =
|
|
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.
|
|
2372
|
+
return "0.2.9";
|
|
2373
2373
|
}
|
|
2374
2374
|
};
|
|
2375
2375
|
// Annotate the CommonJS export names for ESM import in node:
|