addigy 2.7.0 → 2.8.0
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/index.js +7 -5
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1124,13 +1124,15 @@ class Addigy {
|
|
|
1124
1124
|
}
|
|
1125
1125
|
async getImpersonationAuthObject(authObject, orgId) {
|
|
1126
1126
|
let postBody = {
|
|
1127
|
-
|
|
1127
|
+
parent_orgid: authObject.orgId,
|
|
1128
|
+
child_orgid: orgId,
|
|
1129
|
+
user_email: authObject.emailAddress,
|
|
1128
1130
|
};
|
|
1129
1131
|
try {
|
|
1130
|
-
let res = await this._addigyRequest('https://
|
|
1132
|
+
let res = await this._addigyRequest('https://app.addigy.com/api/impersonation', {
|
|
1131
1133
|
headers: {
|
|
1132
|
-
Cookie: `
|
|
1133
|
-
origin: 'https://app
|
|
1134
|
+
Cookie: `prod_auth_token=${authObject.authToken};`,
|
|
1135
|
+
origin: 'https://app.addigy.com',
|
|
1134
1136
|
},
|
|
1135
1137
|
method: 'POST',
|
|
1136
1138
|
json: postBody,
|
|
@@ -1138,7 +1140,7 @@ class Addigy {
|
|
|
1138
1140
|
let impersonationAuthObject = {
|
|
1139
1141
|
orgId: orgId,
|
|
1140
1142
|
authToken: res.headers['set-cookie']
|
|
1141
|
-
.find((e) => e.includes('
|
|
1143
|
+
.find((e) => e.includes('prod_auth_token') && !e.includes('original_auth_token'))
|
|
1142
1144
|
.split('auth_token=')[1]
|
|
1143
1145
|
.split(';')[0],
|
|
1144
1146
|
emailAddress: authObject.emailAddress,
|