@intercom/cli 0.14.0 → 0.14.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 +6 -0
- package/dist/index.js +15 -3
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
View it from the CLI with `intercom changelog`.
|
|
9
9
|
|
|
10
|
+
## [0.14.1] - 2026-10-27
|
|
11
|
+
|
|
12
|
+
### Fixed
|
|
13
|
+
|
|
14
|
+
- `intercom auth signup` no longer reads its CSRF token from the old signup page, which is moving to the new signup site. It now gets the token from the signup state endpoint, so signup keeps working after the old page redirects.
|
|
15
|
+
|
|
10
16
|
## [0.14.0] - 2026-09-02
|
|
11
17
|
|
|
12
18
|
### Added
|
package/dist/index.js
CHANGED
|
@@ -933,6 +933,19 @@ async function fetchCsrfToken(url, timeoutMs = API_TIMEOUT_MS, init) {
|
|
|
933
933
|
if (!match) throw new Error("Could not find CSRF token");
|
|
934
934
|
return { token: match[1], cookies: extractCookies(response) };
|
|
935
935
|
}
|
|
936
|
+
async function fetchSignupCsrfToken(baseUrl, timeoutMs) {
|
|
937
|
+
const url = `${baseUrl}/ember/signups/state`;
|
|
938
|
+
const response = await fetchWithTimeout(
|
|
939
|
+
url,
|
|
940
|
+
{ headers: { Accept: "application/json" } },
|
|
941
|
+
{ timeoutMs }
|
|
942
|
+
);
|
|
943
|
+
if (!response.ok)
|
|
944
|
+
throw new AuthError(`Failed to fetch ${url}: ${response.status}`);
|
|
945
|
+
const data = await response.json();
|
|
946
|
+
if (!data.csrf_token) throw new AuthError("Could not find CSRF token");
|
|
947
|
+
return { token: data.csrf_token, cookies: extractCookies(response) };
|
|
948
|
+
}
|
|
936
949
|
async function signup(options) {
|
|
937
950
|
const {
|
|
938
951
|
baseUrl,
|
|
@@ -943,9 +956,8 @@ async function signup(options) {
|
|
|
943
956
|
plan = "advanced",
|
|
944
957
|
timeoutMs = API_TIMEOUT_MS
|
|
945
958
|
} = options;
|
|
946
|
-
const
|
|
947
|
-
|
|
948
|
-
csrfUrl,
|
|
959
|
+
const { token: csrfToken, cookies } = await fetchSignupCsrfToken(
|
|
960
|
+
baseUrl,
|
|
949
961
|
timeoutMs
|
|
950
962
|
);
|
|
951
963
|
const solutionId = PLAN_SOLUTION_IDS[plan] ?? PLAN_SOLUTION_IDS["advanced"];
|