diff --git a/.changeset/fresh-plums-heal.md b/.changeset/fresh-plums-heal.md new file mode 100644 index 000000000..121204d19 --- /dev/null +++ b/.changeset/fresh-plums-heal.md @@ -0,0 +1,5 @@ +--- +"@tonightpass/kitchen": patch +--- + +Fix parseCookieString function diff --git a/packages/kitchen/src/utils/parseCookieString.ts b/packages/kitchen/src/utils/parseCookieString.ts index c70143112..afe93386b 100644 --- a/packages/kitchen/src/utils/parseCookieString.ts +++ b/packages/kitchen/src/utils/parseCookieString.ts @@ -3,7 +3,12 @@ const parseCookieString = (cookieString: string) => { const cookieObject = cookieArray.reduce((acc, cookie) => { const [key, encodedValue] = cookie.split("="); const value = decodeURIComponent(encodedValue); - const parsedValue = value !== "undefined" ? JSON.parse(value) : undefined; + const parsedValue = + value !== "undefined" + ? value.includes(":") + ? value + : JSON.parse(value) + : undefined; return { ...acc, [key.trim()]: parsedValue }; }, {}); return cookieObject;