Skip to content

Commit

Permalink
fixes conditional logic for consent allows function (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
BrettBlox committed Mar 22, 2023
1 parent 99b0664 commit 105802d
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions modules/concertBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -204,10 +204,16 @@ function hasOptedOutOfPersonalization() {
* @param {BidderRequest} bidderRequest Object which contains any data consent signals
*/
function consentAllowsPpid(bidderRequest) {
const uspConsentAllows =
let uspConsentAllows = true;

// if a us privacy string was provided, but they explicitly opted out
if (
typeof bidderRequest?.uspConsent === 'string' &&
bidderRequest?.uspConsent[0] === '1' &&
bidderRequest?.uspConsent[2].toUpperCase() === 'N';
bidderRequest?.uspConsent[2].toUpperCase() === 'Y' // user has opted-out
) {
uspConsentAllows = false;
}

/*
* True if the gdprConsent is null-y; or GDPR does not apply; or if purpose 1 consent was given.
Expand Down

0 comments on commit 105802d

Please sign in to comment.