File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- import { confirm , password } from '@inquirer/prompts' ;
1+ import { confirm , password , select } from '@inquirer/prompts' ;
22import { ux } from '@oclif/core' ;
33import { createAccountsHubClient , PowerSyncCommand , Services } from '@powersync/cli-core' ;
44import { createServer } from 'node:http' ;
@@ -58,12 +58,15 @@ export default class Login extends PowerSyncCommand {
5858 }
5959 }
6060
61- const shouldOpenBrowser = await confirm ( {
62- message : 'Do you want to open the browser to create a new token?' ,
63- default : false
61+ const tokenMethod = await select ( {
62+ message : 'How would you like to provide your token?' ,
63+ choices : [
64+ { value : 'browser' , name : 'Open a browser to generate a token' } ,
65+ { value : 'existing' , name : 'Enter an existing token' }
66+ ]
6467 } ) ;
6568
66- const token = shouldOpenBrowser
69+ const token = tokenMethod === 'browser'
6770 ? await new Promise < string > ( ( resolve , reject ) => {
6871 const server = createServer ( ) ;
6972 const spinner = ora ( 'Waiting for you to create a token in the dashboard…' ) . start ( ) ;
You can’t perform that action at this time.
0 commit comments