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.
@@ -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 = { authorization: `Bearer ${access_token}` };
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,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hevy-shared",
3
- "version": "1.0.943",
3
+ "version": "1.0.945",
4
4
  "description": "",
5
5
  "main": "built/index.js",
6
6
  "types": "built/index.d.ts",