lib/pxapi.js
function isBadRiskScore(res, ctx, config) {
    if (!res || !pxUtil.verifyDefined(res.score) || !res.action) {
        ctx.passReason = config.PASS_REASON.INVALID_RESPONSE;
        return -1;
    }
    const score = res.score;
    ctx.score = score;
    ctx.uuid = res.uuid;
    if (score >= config.BLOCKING_SCORE) {
        ctx.blockAction = res.action;
        if (res.action === 'j' && res.action_data && res.action_data.body) {
            ctx.blockActionData = res.action_data.body;
        }
        return 0;
    } else {
        ctx.passReason =  config.PASS_REASON.S2S;
        return 1;
    }
}
function isBadRiskScore(res, ctx, config) {
    if (!res || !pxUtil.verifyDefined(res.score) || !res.action) {
        ctx.passReason = config.PASS_REASON.INVALID_RESPONSE;
        return -1;
    }
    const score = res.score;
    ctx.score = score;
    ctx.uuid = res.uuid;
    if (score >= config.BLOCKING_SCORE) {
        ctx.blockAction = res.action;
        if (res.action === 'j' && res.action_data && res.action_data.body) {
            ctx.blockActionData = res.action_data.body;
        }
        return 0;
    } else {
        ctx.passReason =  config.PASS_REASON.S2S;
        return 1;
    }
}
function isBadRiskScore ( res , ctx , config ) { if ( ! res || ! pxUtil . verifyDefined ( res . score ) || ! res . action ) { ctx . passReason = config . PASS_REASON . INVALID_RESPONSE ; return - 1 ; } const score = res . score ; ctx . score = score ; ctx . uuid = res . uuid ; if ( score >= config . BLOCKING_SCORE ) { ctx . blockAction = res . action ; if ( res . action === 'j' && res . action_data && res . action_data . body ) { ctx . blockActionData = res . action_data . body ; } return 0 ; } else { ctx . passReason = config . PASS_REASON . S2S ; return 1 ; } }
isBadRiskScore - processing response score and return a block indicator.

@param {object} res - perimeterx response object.
@param {object} ctx - current request context.

@return {Number} indicator to the validity of the cookie.
-1 response object is not valid
0 response valid with bad score
1 response valid with good score
isBadRiskScore - processing response score and return a block indicator .