leadconduit-trustedform 1.17.0 → 1.17.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,10 @@
2
2
  All notable changes to this project will be documented in this file.
3
3
  This project adheres to [Semantic Versioning](http://semver.org)
4
4
 
5
+ ## [1.17.1] - 2021-12-10
6
+ ### Fixed
7
+ - Fixed to ensure `consent` doesn't append cert data, even when present in the response
8
+
5
9
  ## [1.17.0] - 2021-12-10
6
10
  ### Added
7
11
  - Added new integrations: [consent](https://app.shortcut.com/active-prospect/story/32490/trustedform-consent-integration) & [consent_plus_data](https://app.shortcut.com/active-prospect/story/32491/trustedform-consent-data-integration)
package/lib/consent.js CHANGED
@@ -88,8 +88,9 @@ const parseResponse = (statusCode, body, vars) => {
88
88
  appended.num_required_matched = countRequiredMatched(get(vars, 'trustedform.scan_required_text'), appended.required_scans_found);
89
89
  }
90
90
 
91
- // include cert data, which should only exist on 'consent_plus_data' responses
92
- if (event.cert && Object.keys(event.cert).length > 0) {
91
+ // cert data should only exist on 'consent_plus_data' responses, but only
92
+ // use it if the plusData flag set by that integration is set
93
+ if (vars.plusData && event.cert && Object.keys(event.cert).length > 0) {
93
94
  Object.assign(appended, parseCertData(event.cert));
94
95
  }
95
96
  } else {
@@ -1,5 +1,10 @@
1
1
  const consent = require('./consent');
2
2
 
3
+ const handle = (vars, callback) => {
4
+ vars.plusData = true;
5
+ consent.handle(vars, callback);
6
+ };
7
+
3
8
  const responseVariables = () => {
4
9
  return consent.responseVariables().concat([
5
10
  { name: 'age_in_seconds', type: 'number', description: 'Number of seconds since the certificate was created' },
@@ -29,7 +34,7 @@ const responseVariables = () => {
29
34
 
30
35
  module.exports = {
31
36
  validate: consent.validate,
32
- handle: consent.handle,
37
+ handle,
33
38
  parseResponse: consent.parseResponse,
34
39
  requestVariables: consent.requestVariables,
35
40
  responseVariables
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "leadconduit-trustedform",
3
- "version": "1.17.0",
3
+ "version": "1.17.1",
4
4
  "description": "LeadConduit integration with TrustedForm",
5
5
  "main": "index.js",
6
6
  "scripts": {