@decocms/apps 0.23.0 → 0.23.1
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/package.json +1 -1
- package/vtex/client.ts +4 -2
- package/vtex/utils/proxy.ts +1 -1
package/package.json
CHANGED
package/vtex/client.ts
CHANGED
|
@@ -483,13 +483,15 @@ export function initVtexFromBlocks(blocks: Record<string, any>) {
|
|
|
483
483
|
console.warn("[VTEX] No vtex.json block found.");
|
|
484
484
|
return;
|
|
485
485
|
}
|
|
486
|
+
const appKey = typeof vtexBlock.appKey === "string" ? vtexBlock.appKey : undefined;
|
|
487
|
+
const appToken = typeof vtexBlock.appToken === "string" ? vtexBlock.appToken : undefined;
|
|
486
488
|
configureVtex({
|
|
487
489
|
account: vtexBlock.account,
|
|
488
490
|
publicUrl: vtexBlock.publicUrl,
|
|
489
491
|
salesChannel: vtexBlock.salesChannel || "1",
|
|
490
492
|
locale: vtexBlock.locale || vtexBlock.defaultLocale,
|
|
491
|
-
appKey
|
|
492
|
-
appToken
|
|
493
|
+
appKey,
|
|
494
|
+
appToken,
|
|
493
495
|
country: vtexBlock.country,
|
|
494
496
|
domain: vtexBlock.domain,
|
|
495
497
|
});
|
package/vtex/utils/proxy.ts
CHANGED
|
@@ -158,7 +158,7 @@ export async function proxyToVtex(
|
|
|
158
158
|
}
|
|
159
159
|
}
|
|
160
160
|
|
|
161
|
-
if (config.appKey && config.appToken) {
|
|
161
|
+
if (typeof config.appKey === "string" && typeof config.appToken === "string") {
|
|
162
162
|
forwardHeaders.set("X-VTEX-API-AppKey", config.appKey);
|
|
163
163
|
forwardHeaders.set("X-VTEX-API-AppToken", config.appToken);
|
|
164
164
|
}
|