From 421de80daf6109a33f59f70a4f6f8d56a60d9e3c Mon Sep 17 00:00:00 2001 From: Addison Beck Date: Sun, 1 Nov 2020 14:57:33 -0500 Subject: [PATCH] Added --apiKey option to the login command --- src/commands/login.command.ts | 2 +- src/program.ts | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/commands/login.command.ts b/src/commands/login.command.ts index 0300926cd8..6220219d94 100644 --- a/src/commands/login.command.ts +++ b/src/commands/login.command.ts @@ -30,7 +30,7 @@ export class LoginCommand extends BaseLoginCommand { }; this.success = async () => { await syncService.fullSync(true); - if (this.cmd.sso != null && this.canInteract) { + if ((this.cmd.sso != null || this.cmd.apiKey != null) && this.canInteract) { const res = new MessageResponse('You are logged in!', '\n' + 'To unlock your vault, use the `unlock` command. ex:\n' + '$ bw unlock'); diff --git a/src/program.ts b/src/program.ts index d34a79eb12..b831f0d10e 100644 --- a/src/program.ts +++ b/src/program.ts @@ -108,6 +108,7 @@ export class Program extends BaseProgram { .option('--method ', 'Two-step login method.') .option('--code ', 'Two-step login code.') .option('--sso', 'Log in with Single-Sign On.') + .option('--apiKey', 'Log in with an Api Key.') .option('--check', 'Check login status.', async () => { const authed = await this.main.userService.isAuthenticated(); if (authed) {