Skip to content

Commit

Permalink
ID5 userId submodule (prebid#3798)
Browse files Browse the repository at this point in the history
* Extract GDPRApplies in userId.js to make it available to cookie-sync requiring it

* Adding id5 userId submodule, tests and documentation

* Fixed typo in test name for unifiedid

* Adding test to userId for ID5

* Follow correct naming convention for GDPRApplies: renamed to isGDPRApplicable

* Refactoring of id5 module following refactoring of userId module.

* Moved init of id5 user module at the end of the id5 module itself

* regroup import to avoid a CircleCI Bug
  • Loading branch information
padurgeat authored and Alex committed Aug 2, 2019
1 parent 0c7efe0 commit 5b8a663
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions modules/userId/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,13 +160,22 @@ function getStoredValue(storage) {
return storedValue;
}

/**
* test if consent module is present, and if GDPR applies
* @param {ConsentData} consentData
* @returns {boolean}
*/
export function isGDPRApplicable(consentData) {
return consentData && typeof consentData.gdprApplies === 'boolean' && consentData.gdprApplies;
}

/**
* test if consent module is present, applies, and is valid for local storage or cookies (purpose 1)
* @param {ConsentData} consentData
* @returns {boolean}
*/
function hasGDPRConsent(consentData) {
if (consentData && typeof consentData.gdprApplies === 'boolean' && consentData.gdprApplies) {
export function hasGDPRConsent(consentData) {
if (isGDPRApplicable(consentData)) {
if (!consentData.consentString) {
return false;
}
Expand Down

0 comments on commit 5b8a663

Please sign in to comment.