1
0
mirror of https://github.com/bitwarden/cli synced 2025-12-11 05:43:20 +00:00

Merge pull request #178 from bitwarden/ApiKeyAuthInTheCli

Implement User-based API Keys
This commit is contained in:
Addison Beck
2020-11-10 15:15:50 -05:00
committed by GitHub
2 changed files with 2 additions and 1 deletions

View File

@@ -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');

View File

@@ -108,6 +108,7 @@ export class Program extends BaseProgram {
.option('--method <method>', 'Two-step login method.')
.option('--code <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) {