You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
apps-vtex: createVtexCheckoutProxy follows VTEX redirects and targets vtexcommercestable (no option to match deco-apps' proxy) #723
createVtexCheckoutProxy (@decocms/apps-vtex/utils/proxy, 7.80.x) diverges from the deco-apps proxy it replaces (vtex/loaders/proxy.ts → website/handlers/proxy.ts) in two ways that break real storefront flows, and neither is configurable:
Redirects are followed for every path outside /checkout*, /account* and /api/vtexid/pub/logout (redirect: isCheckoutUI || isLogout ? "manual" : "follow"). deco-apps defaults to redirect: "manual" and rewrites Location instead. VtexCheckoutProxyConfig exposes no redirect option.
API paths go to {account}.vtexcommercestable.{domain} (apiOrigin default) while deco-apps sends every proxied path (/api/*, /_v/*, /no-cache/*, /assets/*, /XMLData/*…) to the store's publicUrl.
Impact (measured on a VTEX store, Fresh prod × TanStack)
vtexcommercestable answers IO routes and unknown paths with 302 /Admin/Site/Login.aspx; the proxy follows it and serves the admin login page as 200 text/html, together with VTEX's vtex_session/vtex_segment/connect.sid cookies:
path
Fresh (publicUrl, manual)
factory
/_v/holidays
200 JSON (read by checkout6-custom.js)
200 HTML login page
/_v/public/assets/…
400
200 HTML
/no-cache/<unknown>
404
200 HTML
/assets/vtex/<unknown>
400
200 HTML
/no-cache/user/logout
302 → VTEX
200 HTML (followed twice)
Following also turns any VTEX redirect back to the storefront host (e.g. /api/vtexid/pub/authentication/redirect?returnUrl=https://<store>/…, the telesales admin login) into a subrequest to the worker's own hostname, which Cloudflare refuses (404 / 1042).
Proposal
Add redirect?: "manual" | "follow" to VtexCheckoutProxyConfig, defaulting to "manual" as deco-apps does (Location rewritten from the upstream origin to the storefront origin).
Allow routing all paths to checkoutOrigin (or default apiOrigin to it when a publicUrl-style host is given), matching deco-apps.
Optionally, scope every Set-Cookie to the storefront host as deco-apps' proxySetCookie does (the factory only replaces an existing Domain, so host-only VTEX cookies such as VtexWorkspace stay host-only).
Site-level workaround in deco-sites/oficina-tanstack: src/sdk/vtex/store-proxy.ts (QA-148 / QA-153).
Activity