Skip to content

Commit

Permalink
Merge pull request #26 from voxmedia/revert-19-cg-update-donotsell
Browse files Browse the repository at this point in the history
Revert "Updates canUsePersonalInformationForTargeting check to look for new Chorus Preferences do not sell cookie"
  • Loading branch information
CGeohagan authored Sep 7, 2022
2 parents 2c6f38b + f45ea22 commit ddd335a
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 39 deletions.
4 changes: 0 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
## 1.5.0 (November 10, 2021)

- Updates canUsePersonalInformationForTargeting check to look for new Chorus Preferences do not sell cookie

## 1.4.0 (July 14th, 2020)

- Updates Chorus to default to default "yes" to the request of "Has been notified of rights" clause of the CCPA
Expand Down
15 changes: 1 addition & 14 deletions dist/data-privacy-compliance.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/data-privacy-compliance.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "data-privacy-compliance",
"version": "1.5.0",
"version": "1.4.0",
"description": "Vox Media's library for implementing data privacy frameworks",
"main": "dist/data-privacy-compliance.js",
"license": "Apache-2.0",
Expand Down
13 changes: 1 addition & 12 deletions src/frameworks/ccpa_on_chorus.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,7 @@ class CcpaOnChorus extends FrameworkBase {
}

canUsePersonalInformationForTargeting() {
return !Cookie.hasCookie('_chorus_ccpa_consent_donotsell') && !this.chorusDoNotSellPreference();
}

chorusDoNotSellPreference() {
if (!Cookie.hasCookie('chorus_preferences')) return false;
try {
const chorusPreferences = JSON.parse(decodeURIComponent(Cookie.getCookie('chorus_preferences')));
return Boolean(chorusPreferences.privacy && chorusPreferences.privacy.doNotSell);
} catch (e) {
console.error(`There was an error obtaining Chorus Preferences do not sell cookie: ${e}`);
return false;
}
return !Cookie.hasCookie('_chorus_ccpa_consent_donotsell');
}

hasBeenNotifiedOfRights() {
Expand Down
9 changes: 2 additions & 7 deletions test/ccpa_on_chorus.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,13 @@ describe('CCPA for Chorus Support', () => {
});
});

describe('it should respect Chorus cookies', () => {
describe('it should repsect Chorus cookies', () => {
beforeEach(() => {
window.Chorus = { fakeData: 'fine' };
});

afterEach(() => {
document.cookie = '';
});

it('should restrict personal info targeting, when the chorus preferences do not sell cookie is set', () => {
document.cookie = 'chorus_preferences={"v":1,"privacy":{"cookies":"essential","doNotSell":true}}';
expect(PrivacyCompliance.canUsePersonalInformationForTargeting()).toBeFalsy();
window.cookie = '';
});

it('should restrict personal info targeting, when opt out of sale cookie is set', () => {
Expand Down

0 comments on commit ddd335a

Please sign in to comment.