From 1b077c3ab47f43e897a9c0d851fead103717a8d4 Mon Sep 17 00:00:00 2001 From: Luis Sousa Date: Tue, 17 Dec 2024 18:05:41 -0300 Subject: [PATCH] wip: fix cookies magento --- magento/utils/utils.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/magento/utils/utils.ts b/magento/utils/utils.ts index 77a5c0a0d..de737c82b 100644 --- a/magento/utils/utils.ts +++ b/magento/utils/utils.ts @@ -8,8 +8,8 @@ export const proxySetCookie = ( ) => { const domain = toDomain && new URL(toDomain); const newDomain = domain && !domain.hostname.includes("localhost") - ? new URL(getTopDomain(domain.hostname)) - : domain; + ? `.${getTopDomain(domain.hostname)}` + : (domain as URL)?.hostname; console.log({ newDomain }); @@ -20,7 +20,7 @@ export const proxySetCookie = ( const newCookie = newDomain ? { ...cookie, - domain: newDomain.hostname, + domain: newDomain, } : cookie;