hevy-shared 1.0.943 → 1.0.945
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/built/API/APIClient.js +6 -3
- package/package.json +1 -1
package/built/API/APIClient.js
CHANGED
|
@@ -49,9 +49,9 @@ class HevyAPIClient {
|
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
51
|
get _authHeaders() {
|
|
52
|
-
return Object.assign(Object.assign({}, (this._authToken
|
|
52
|
+
return Object.assign(Object.assign(Object.assign({}, (this._authToken
|
|
53
53
|
? { authorization: `Bearer ${this._authToken.access_token}` }
|
|
54
|
-
: {})), (this._legacyAuthToken ? { 'auth-token': this._legacyAuthToken } : {}));
|
|
54
|
+
: {})), (this._legacyAuthToken ? { 'auth-token': this._legacyAuthToken } : {})), { 'x-client-time': String(new Date().valueOf() / 1000) });
|
|
55
55
|
}
|
|
56
56
|
refreshExpiredAuthToken(userContext) {
|
|
57
57
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -99,7 +99,10 @@ class HevyAPIClient {
|
|
|
99
99
|
this._lastTokenRefresh = new Date();
|
|
100
100
|
const { access_token, refresh_token } = authToken;
|
|
101
101
|
const { method, url } = this.refreshAuthTokenApiEndpoint;
|
|
102
|
-
const headers = {
|
|
102
|
+
const headers = {
|
|
103
|
+
authorization: `Bearer ${access_token}`,
|
|
104
|
+
'x-client-time': String(new Date().valueOf() / 1000),
|
|
105
|
+
};
|
|
103
106
|
// This will throw and bail out if the request fails.
|
|
104
107
|
const response = yield this._handleResponse({
|
|
105
108
|
method,
|