apiblaze 0.19.30 → 0.19.32
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/dist/index.js +9 -7
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -932,7 +932,7 @@ var import_commander = require("commander");
|
|
|
932
932
|
var import_chalk48 = __toESM(require("chalk"));
|
|
933
933
|
|
|
934
934
|
// package.json
|
|
935
|
-
var version = "0.19.
|
|
935
|
+
var version = "0.19.32";
|
|
936
936
|
|
|
937
937
|
// src/index.ts
|
|
938
938
|
init_types();
|
|
@@ -2565,10 +2565,13 @@ async function deviceLogin(clientId, scope, onPrompt, resource) {
|
|
|
2565
2565
|
const tokRes = await fetch(`${AUTH_BASE}/token`, {
|
|
2566
2566
|
method: "POST",
|
|
2567
2567
|
headers: { "Content-Type": "application/x-www-form-urlencoded" },
|
|
2568
|
-
// RFC 8707 resource indicator
|
|
2569
|
-
//
|
|
2570
|
-
//
|
|
2571
|
-
//
|
|
2568
|
+
// RFC 8707 resource indicator, forwarded only when the caller asks for one.
|
|
2569
|
+
// The device grant used to fall back to aud=https://auth.apiblaze.com/device/callback,
|
|
2570
|
+
// which is registered nowhere and so accepted by nothing — every caller had to
|
|
2571
|
+
// supply a resource just to get a usable token, and the one supplied here was
|
|
2572
|
+
// a fabricated `…/1.0.0`. The token endpoint now floors the device grant on
|
|
2573
|
+
// client_id (always an accepted audience), so omitting this is the correct
|
|
2574
|
+
// default and a resource is only needed to CONFINE a token.
|
|
2572
2575
|
body: new URLSearchParams({ grant_type: DEVICE_GRANT, device_code: deviceCode, code_verifier: verifier, ...resource ? { resource } : {} })
|
|
2573
2576
|
});
|
|
2574
2577
|
const tok = await tokRes.json().catch(() => ({}));
|
|
@@ -7959,7 +7962,6 @@ async function runConsumerLogin(opts) {
|
|
|
7959
7962
|
}
|
|
7960
7963
|
clientId = pick2.client_id ?? pick2.clientId;
|
|
7961
7964
|
}
|
|
7962
|
-
const portalResource = `https://${tenant2}.portal.apiblaze.com/1.0.0`;
|
|
7963
7965
|
console.log(`${import_chalk44.default.cyan("\u2192")} Logging in to ${import_chalk44.default.bold(tenant2)} as a consumer...`);
|
|
7964
7966
|
const result = await deviceLogin(clientId, DEFAULT_SCOPE, ({ verificationUri, userCode }) => {
|
|
7965
7967
|
console.log(`
|
|
@@ -7967,7 +7969,7 @@ async function runConsumerLogin(opts) {
|
|
|
7967
7969
|
console.log(` Code: ${import_chalk44.default.bold(userCode)}
|
|
7968
7970
|
`);
|
|
7969
7971
|
console.log(import_chalk44.default.dim(" (opening your browser\u2026 waiting for you to finish)"));
|
|
7970
|
-
}
|
|
7972
|
+
});
|
|
7971
7973
|
const claims = result.idToken && decodeJwt2(result.idToken) || (decodeJwt2(result.accessToken) ?? {});
|
|
7972
7974
|
const creds = {
|
|
7973
7975
|
tenant: tenant2,
|