@wix/sdk 1.19.0 → 1.20.0

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.
@@ -156,12 +156,14 @@ export function createClient(config) {
156
156
  const wrappedModules = config.modules
157
157
  ? use(config.modules)
158
158
  : {};
159
- const authStrategy = getAuthStrategy();
160
- const originalGetAuthHeaders = authStrategy.getAuthHeaders;
161
- authStrategy.getAuthHeaders = originalGetAuthHeaders.bind(undefined, config.host);
162
159
  return {
163
160
  ...wrappedModules,
164
- auth: authStrategy,
161
+ get auth() {
162
+ const authStrategy = getAuthStrategy();
163
+ const originalGetAuthHeaders = authStrategy.getAuthHeaders;
164
+ authStrategy.getAuthHeaders = originalGetAuthHeaders.bind(undefined, config.host);
165
+ return authStrategy;
166
+ },
165
167
  setHeaders,
166
168
  use,
167
169
  enableContext(contextType, opts = { elevated: false }) {
@@ -160,12 +160,14 @@ function createClient(config) {
160
160
  const wrappedModules = config.modules
161
161
  ? use(config.modules)
162
162
  : {};
163
- const authStrategy = getAuthStrategy();
164
- const originalGetAuthHeaders = authStrategy.getAuthHeaders;
165
- authStrategy.getAuthHeaders = originalGetAuthHeaders.bind(undefined, config.host);
166
163
  return {
167
164
  ...wrappedModules,
168
- auth: authStrategy,
165
+ get auth() {
166
+ const authStrategy = getAuthStrategy();
167
+ const originalGetAuthHeaders = authStrategy.getAuthHeaders;
168
+ authStrategy.getAuthHeaders = originalGetAuthHeaders.bind(undefined, config.host);
169
+ return authStrategy;
170
+ },
169
171
  setHeaders,
170
172
  use,
171
173
  enableContext(contextType, opts = { elevated: false }) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/sdk",
3
- "version": "1.19.0",
3
+ "version": "1.20.0",
4
4
  "license": "MIT",
5
5
  "author": {
6
6
  "name": "Ronny Ringel",
@@ -126,5 +126,5 @@
126
126
  "wallaby": {
127
127
  "autoDetect": true
128
128
  },
129
- "falconPackageHash": "63afb7d530a2d141dbd766ef8d0c61a8a391c81110da69913d9fd6d8"
129
+ "falconPackageHash": "4073f5e283bbe708a3e8e45d798f3998874111ad3aab43d426686c29"
130
130
  }