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.
Files changed (2) hide show
  1. package/bin/prior.js +11 -37
  2. 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
- console.log(c.bold(' Sign in\n'));
461
- console.log(` ${c.brand('[1]')} Login manually`);
462
- console.log(` ${c.brand('[2]')} Login in browser`);
463
- console.log('');
464
-
465
- const choiceRl = readline.createInterface({ input: process.stdin, output: process.stdout });
466
- const choice = await ask(choiceRl, c.muted(' Choice [1/2] : '));
467
- choiceRl.close();
468
- console.log('');
469
-
470
- if (choice === '2') {
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 ──────────────────────────────────────
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "prior-cli",
3
- "version": "1.2.7",
3
+ "version": "1.2.8",
4
4
  "description": "Prior Network AI — command-line interface",
5
5
  "bin": {
6
6
  "prior": "bin/prior.js"