@kill-switch/cli 0.3.1 → 0.3.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/dist/commands/auth.js +6 -2
- package/package.json +1 -1
package/dist/commands/auth.js
CHANGED
|
@@ -101,8 +101,12 @@ export function registerAuthCommands(program, createClient) {
|
|
|
101
101
|
.option("--api-key <key>", "Personal API key (starts with ks_) — skips browser flow")
|
|
102
102
|
.action(async (opts) => {
|
|
103
103
|
const json = program.opts().json;
|
|
104
|
-
const apiUrl = resolveApiUrl();
|
|
105
|
-
|
|
104
|
+
const apiUrl = resolveApiUrl(program.opts().apiUrl);
|
|
105
|
+
// The program also declares a global --api-key/--api-url; by commander's
|
|
106
|
+
// parent/child precedence the value lands on the PARENT even when passed
|
|
107
|
+
// after `login`, leaving opts.apiKey undefined. Read from either place so
|
|
108
|
+
// `ks auth login --api-key KEY` actually works.
|
|
109
|
+
let key = opts.apiKey ?? program.opts().apiKey;
|
|
106
110
|
// Device flow when no --api-key. JSON mode requires --api-key (no browser).
|
|
107
111
|
if (!key) {
|
|
108
112
|
if (json) {
|