leadconduit-trustedform 1.17.1 → 1.17.2
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 +4 -0
- package/lib/consent.js +2 -2
- package/package.json +1 -1
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.2] - 2021-12-21
|
|
6
|
+
### Fixed
|
|
7
|
+
- Fixed to use returned `reason` on 40x responses ([sc-33842](https://app.shortcut.com/active-prospect/story/33842/trustedform-consent-consent-data-return-incorrect-reason))
|
|
8
|
+
|
|
5
9
|
## [1.17.1] - 2021-12-10
|
|
6
10
|
### Fixed
|
|
7
11
|
- Fixed to ensure `consent` doesn't append cert data, even when present in the response
|
package/lib/consent.js
CHANGED
|
@@ -96,7 +96,7 @@ const parseResponse = (statusCode, body, vars) => {
|
|
|
96
96
|
} else {
|
|
97
97
|
// handle all non-201 statuses
|
|
98
98
|
let errorMessage = get(event, 'errors.detail');
|
|
99
|
-
if (errorMessage === 'Unauthorized') {
|
|
99
|
+
if (errorMessage === 'Unauthorized' || event.outcome === 'failure') {
|
|
100
100
|
appended.outcome = 'failure';
|
|
101
101
|
} else {
|
|
102
102
|
appended.outcome = 'error';
|
|
@@ -107,7 +107,7 @@ const parseResponse = (statusCode, body, vars) => {
|
|
|
107
107
|
errorMessage = event.message;
|
|
108
108
|
}
|
|
109
109
|
}
|
|
110
|
-
|
|
110
|
+
appended.reason = errorMessage ? `TrustedForm error - ${errorMessage} (${statusCode})` : event.reason;
|
|
111
111
|
}
|
|
112
112
|
|
|
113
113
|
return appended;
|