prior-cli 1.2.7 → 1.2.8
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/bin/prior.js +11 -37
- package/package.json +1 -1
package/bin/prior.js
CHANGED
|
@@ -457,44 +457,18 @@ async function loginViaBrowser() {
|
|
|
457
457
|
|
|
458
458
|
// ── Inline login flow ──────────────────────────────────────────
|
|
459
459
|
async function doLoginFlow() {
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
process.stdout.write(c.dim(' Opening browser…'));
|
|
472
|
-
try {
|
|
473
|
-
const { token, username } = await loginViaBrowser();
|
|
474
|
-
saveAuth(token, username);
|
|
475
|
-
clearLine();
|
|
476
|
-
console.log(c.ok(' ✓ Logged in as ') + c.bold(username));
|
|
477
|
-
console.log('');
|
|
478
|
-
return username;
|
|
479
|
-
} catch (err) {
|
|
480
|
-
clearLine();
|
|
481
|
-
throw err;
|
|
482
|
-
}
|
|
460
|
+
process.stdout.write(c.dim(' Opening browser…'));
|
|
461
|
+
try {
|
|
462
|
+
const { token, username } = await loginViaBrowser();
|
|
463
|
+
saveAuth(token, username);
|
|
464
|
+
clearLine();
|
|
465
|
+
console.log(c.ok(' ✓ Logged in as ') + c.bold(username));
|
|
466
|
+
console.log('');
|
|
467
|
+
return username;
|
|
468
|
+
} catch (err) {
|
|
469
|
+
clearLine();
|
|
470
|
+
throw err;
|
|
483
471
|
}
|
|
484
|
-
|
|
485
|
-
// Default: manual
|
|
486
|
-
const manualRl = readline.createInterface({ input: process.stdin, output: process.stdout });
|
|
487
|
-
const username = await ask(manualRl, c.muted(' Username : '));
|
|
488
|
-
manualRl.close();
|
|
489
|
-
const password = await promptPassword(c.muted(' Password : '));
|
|
490
|
-
console.log('');
|
|
491
|
-
process.stdout.write(c.dim(' Authenticating…'));
|
|
492
|
-
const data = await api.login(username, password);
|
|
493
|
-
saveAuth(data.token, username);
|
|
494
|
-
clearLine();
|
|
495
|
-
console.log(c.ok(' ✓ Logged in as ') + c.bold(username));
|
|
496
|
-
console.log('');
|
|
497
|
-
return username;
|
|
498
472
|
}
|
|
499
473
|
|
|
500
474
|
// ── Organization ToS flow ──────────────────────────────────────
|