@shopify/hydrogen 2026.4.7 → 2026.4.8

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.
@@ -314,7 +314,7 @@ function getPrivacyBanner() {
314
314
  }
315
315
 
316
316
  // package.json
317
- var version = "2026.4.7";
317
+ var version = "2026.4.8";
318
318
 
319
319
  // src/analytics-manager/ShopifyAnalytics.tsx
320
320
  function getCustomerPrivacyRequired() {
@@ -1698,7 +1698,7 @@ function generateUUID() {
1698
1698
  }
1699
1699
 
1700
1700
  // src/version.ts
1701
- var LIB_VERSION = "2026.4.7";
1701
+ var LIB_VERSION = "2026.4.8";
1702
1702
 
1703
1703
  // src/utils/graphql.ts
1704
1704
  function minifyQuery(string) {
@@ -3382,7 +3382,7 @@ function useOptimisticCart(cart) {
3382
3382
  }
3383
3383
 
3384
3384
  // src/changelogHandler.ts
3385
- var DEFAULT_GITHUB_CHANGELOG_URL = "https://raw.githubusercontent.com/Shopify/hydrogen/main/docs/changelog.json";
3385
+ var DEFAULT_GITHUB_CHANGELOG_URL = "https://raw.githubusercontent.com/Shopify/hydrogen/2026-04/docs/changelog.json";
3386
3386
  async function changelogHandler({
3387
3387
  request,
3388
3388
  changelogUrl
@@ -3686,6 +3686,17 @@ function getRedirectUrl(requestUrl) {
3686
3686
  }
3687
3687
  }
3688
3688
  }
3689
+ function getSameOriginPath(target, origin) {
3690
+ if (!target) return void 0;
3691
+ try {
3692
+ const url = target.startsWith("/") ? new URL(target, origin) : new URL(target);
3693
+ if (url.origin !== origin) return void 0;
3694
+ const path = `${url.pathname}${url.search}${url.hash}`;
3695
+ return path.startsWith("//") ? void 0 : path;
3696
+ } catch {
3697
+ return void 0;
3698
+ }
3699
+ }
3689
3700
  function isLocalPath(requestUrl, redirectUrl) {
3690
3701
  try {
3691
3702
  return new URL(requestUrl).origin === new URL(redirectUrl, requestUrl).origin;
@@ -4024,7 +4035,9 @@ function createCustomerAccountClient({
4024
4035
  codeVerifier: verifier,
4025
4036
  state,
4026
4037
  nonce,
4027
- redirectPath: getRedirectUrl(request.url) || getHeader(request, "Referer") || defaultRedirectPath
4038
+ redirectPath: getRedirectUrl(request.url) || // The same HTTPS origin the OAuth `redirect_uri` uses, so an http
4039
+ // `request.url` still matches the https pages customers browse.
4040
+ getSameOriginPath(getHeader(request, "Referer"), httpsOrigin) || defaultRedirectPath
4028
4041
  });
4029
4042
  loginUrl.searchParams.append("code_challenge", challenge);
4030
4043
  loginUrl.searchParams.append("code_challenge_method", "S256");