diff --git a/clients/fides-js/src/lib/tcf/utils.ts b/clients/fides-js/src/lib/tcf/utils.ts index 51cddd925c4..d3b19d8c3e3 100644 --- a/clients/fides-js/src/lib/tcf/utils.ts +++ b/clients/fides-js/src/lib/tcf/utils.ts @@ -10,7 +10,8 @@ export const transformFidesStringToCookieKeys = ( debug: boolean ): TcfCookieConsent => { // Defer: to fully support AC string, we need to split out TC from AC string https://github.com/ethyca/fides/issues/4263 - const tcModel: TCModel = TCString.decode(fidesString || ""); + const tcString = (fidesString || "").split(",")[0]; + const tcModel: TCModel = TCString.decode(tcString); const cookieKeys: TcfCookieConsent = {}; diff --git a/clients/privacy-center/cypress/e2e/consent-banner-tcf.cy.ts b/clients/privacy-center/cypress/e2e/consent-banner-tcf.cy.ts index 6f79f3397f5..ca697a1ae9d 100644 --- a/clients/privacy-center/cypress/e2e/consent-banner-tcf.cy.ts +++ b/clients/privacy-center/cypress/e2e/consent-banner-tcf.cy.ts @@ -1443,7 +1443,7 @@ describe("Fides-js TCF", () => { it("prefers preferences from fides_string option when fides_string, experience, and cookie exist", () => { setFidesCookie(); const fidesStringOverride = - "CPzevcAPzevcAGXABBENATEIAAIAAAAAAAAAAAAAAAAA.IABE"; + "CPzevcAPzevcAGXABBENATEIAAIAAAAAAAAAAAAAAAAA.IABE,1~"; const expectedTCString = "CPzevcAPzevcAGXABBENATEIAAIAAAAAAAAAAAAAAAAA"; // without disclosed vendors cy.fixture("consent/experience_tcf.json").then((experience) => { stubConfig({ @@ -1534,7 +1534,7 @@ describe("Fides-js TCF", () => { */ it("prefers preferences from fides_string option when both fides_string and experience is provided and cookie does not exist", () => { const fidesStringOverride = - "CPzevcAPzevcAGXABBENATEIAAIAAAAAAAAAAAAAAAAA.IABE"; + "CPzevcAPzevcAGXABBENATEIAAIAAAAAAAAAAAAAAAAA.IABE,1~"; const expectedTCString = "CPzevcAPzevcAGXABBENATEIAAIAAAAAAAAAAAAAAAAA"; // without disclosed vendors cy.fixture("consent/experience_tcf.json").then((experience) => { stubConfig({ @@ -1625,7 +1625,7 @@ describe("Fides-js TCF", () => { */ it("does nothing when fides_string option when both fides_string option and cookie exist but no experience exists (neither prefetch nor API)", () => { const fidesStringOverride = - "CPzevcAPzevcAGXABBENATEIAAIAAAAAAAAAAAAAAAAA.IABE"; + "CPzevcAPzevcAGXABBENATEIAAIAAAAAAAAAAAAAAAAA.IABE,1~"; setFidesCookie(); stubConfig( { @@ -1656,7 +1656,7 @@ describe("Fides-js TCF", () => { */ it("prefers preferences from fides_string option when both fides_string option and cookie exist and experience is fetched from API", () => { const fidesStringOverride = - "CPzevcAPzevcAGXABBENATEIAAIAAAAAAAAAAAAAAAAA.IABE"; + "CPzevcAPzevcAGXABBENATEIAAIAAAAAAAAAAAAAAAAA.IABE,1~"; const expectedTCString = "CPzevcAPzevcAGXABBENATEIAAIAAAAAAAAAAAAAAAAA"; // without disclosed vendors setFidesCookie(); cy.fixture("consent/experience_tcf.json").then((experience) => { @@ -1749,7 +1749,7 @@ describe("Fides-js TCF", () => { describe("fides_string override options", () => { it("uses fides_string when set via cookie", () => { const fidesStringOverride = - "CPzevcAPzevcAGXABBENATEIAAIAAAAAAAAAAAAAAAAA.IABE"; + "CPzevcAPzevcAGXABBENATEIAAIAAAAAAAAAAAAAAAAA.IABE,1~"; const expectedTCString = "CPzevcAPzevcAGXABBENATEIAAIAAAAAAAAAAAAAAAAA"; // without disclosed vendors cy.getCookie("fides_string").should("not.exist"); cy.setCookie("fides_string", fidesStringOverride); @@ -1793,7 +1793,7 @@ describe("Fides-js TCF", () => { it("uses fides_string when set via query param", () => { const fidesStringOverride = - "CPzevcAPzevcAGXABBENATEIAAIAAAAAAAAAAAAAAAAA.IABE"; + "CPzevcAPzevcAGXABBENATEIAAIAAAAAAAAAAAAAAAAA.IABE,1~"; const expectedTCString = "CPzevcAPzevcAGXABBENATEIAAIAAAAAAAAAAAAAAAAA"; // without disclosed vendors cy.getCookie("fides_string").should("not.exist"); cy.fixture("consent/experience_tcf.json").then((experience) => { @@ -1841,7 +1841,7 @@ describe("Fides-js TCF", () => { it("uses fides_string when set via window obj", () => { const fidesStringOverride = - "CPzevcAPzevcAGXABBENATEIAAIAAAAAAAAAAAAAAAAA.IABE"; + "CPzevcAPzevcAGXABBENATEIAAIAAAAAAAAAAAAAAAAA.IABE,1~"; const expectedTCString = "CPzevcAPzevcAGXABBENATEIAAIAAAAAAAAAAAAAAAAA"; // without disclosed vendors cy.getCookie("fides_string").should("not.exist"); cy.fixture("consent/experience_tcf.json").then((experience) => {