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.
Files changed (2) hide show
  1. package/index.js +7 -5
  2. 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
- orgid: orgId,
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://prod.addigy.com/impersonate_org/', {
1132
+ let res = await this._addigyRequest('https://app.addigy.com/api/impersonation', {
1131
1133
  headers: {
1132
- Cookie: `auth_token=${authObject.authToken};`,
1133
- origin: 'https://app-prod.addigy.com',
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('auth_token') && !e.includes('original_auth_token'))
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,
package/package.json CHANGED
@@ -59,7 +59,7 @@
59
59
  "tsc": "tsc -p tsconfig.build.json"
60
60
  },
61
61
  "types": "index.d.ts",
62
- "version": "2.7.0",
62
+ "version": "2.8.0",
63
63
  "volta": {
64
64
  "node": "14.17.1",
65
65
  "yarn": "1.22.10"