diff --git a/README.md b/README.md index 964caf6b..293455cc 100644 --- a/README.md +++ b/README.md @@ -528,12 +528,9 @@ Logs into your Internxt account using the web-based login flow. A temporary loca ``` USAGE - $ internxt login [--json] [-x] [--debug] [-h ] [-p ] + $ internxt login [--json] [-x] [--debug] [-p ] FLAGS - -h, --host= [env: INXT_LOGIN_SERVER_HOST] IP address of the machine where the CLI is running. If you are - opening the login page in a browser on another device, set this to the IP address of the machine - running the CLI. Defaults to 127.0.0.1. -p, --port= [env: INXT_LOGIN_SERVER_PORT] Port used by the temporary local server to handle the login callback. If not specified, a random available port will be used automatically. diff --git a/src/commands/login.ts b/src/commands/login.ts index 31fb9831..243470b6 100644 --- a/src/commands/login.ts +++ b/src/commands/login.ts @@ -14,16 +14,6 @@ export default class Login extends Command { static readonly examples = ['<%= config.bin %> <%= command.id %>']; static readonly flags = { ...CLIUtils.CommonFlags, - host: Flags.string({ - char: 'h', - aliases: ['host'], - env: 'INXT_LOGIN_SERVER_HOST', - description: - 'IP address of the machine where the CLI is running. ' + - 'If you are opening the login page in a browser on another device, ' + - 'set this to the IP address of the machine running the CLI. Defaults to 127.0.0.1.', - required: false, - }), port: Flags.integer({ char: 'p', aliases: ['port'], @@ -39,12 +29,10 @@ export default class Login extends Command { public run = async () => { const { flags } = await this.parse(Login); - const host = flags['host']; const port = flags['port']; const loginCredentials = await UniversalLinkService.instance.loginSSO( flags['json'] ?? false, this.log.bind(this), - host, port, ); diff --git a/src/services/universal-link.service.ts b/src/services/universal-link.service.ts index b68d6c7e..2ee4febc 100644 --- a/src/services/universal-link.service.ts +++ b/src/services/universal-link.service.ts @@ -46,12 +46,7 @@ export class UniversalLinkService { return `${loginURL}?${params.toString()}`; }; - public loginSSO = async ( - jsonFlag: boolean, - reporter: LogReporter, - hostIp = '127.0.0.1', - forcedPort = 0, - ): Promise => { + public loginSSO = async (jsonFlag: boolean, reporter: LogReporter, forcedPort = 0): Promise => { return new Promise((resolve, reject) => { const server = http.createServer(async (req, res) => { if (!req.url) return; @@ -90,7 +85,7 @@ export class UniversalLinkService { server.listen(forcedPort, async () => { const { port } = server.address() as AddressInfo; - const redirectUri = Buffer.from(`http://${hostIp}:${port}/callback`).toString('base64'); + const redirectUri = Buffer.from(`http://127.0.0.1:${port}/callback`).toString('base64'); const loginUrl = this.buildLoginUrl(redirectUri); CLIUtils.log(reporter, 'Opening browser for login...');