mirror of
https://github.com/bitwarden/browser
synced 2025-12-18 09:13:33 +00:00
committed by
Kyle Spearrin
parent
ddf3733f65
commit
89419c4fa5
@@ -119,11 +119,13 @@ export class Program extends BaseProgram {
|
|||||||
writeLn('', true);
|
writeLn('', true);
|
||||||
})
|
})
|
||||||
.action(async (email: string, password: string, cmd: program.Command) => {
|
.action(async (email: string, password: string, cmd: program.Command) => {
|
||||||
|
if (!cmd.check) {
|
||||||
await this.exitIfAuthed();
|
await this.exitIfAuthed();
|
||||||
const command = new LoginCommand(this.main.authService, this.main.apiService,
|
const command = new LoginCommand(this.main.authService, this.main.apiService,
|
||||||
this.main.cryptoFunctionService, this.main.syncService, this.main.i18nService);
|
this.main.cryptoFunctionService, this.main.syncService, this.main.i18nService);
|
||||||
const response = await command.run(email, password, cmd);
|
const response = await command.run(email, password, cmd);
|
||||||
this.processResponse(response);
|
this.processResponse(response);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
program
|
program
|
||||||
@@ -176,12 +178,22 @@ export class Program extends BaseProgram {
|
|||||||
writeLn(' bw unlock myPassword321 --raw');
|
writeLn(' bw unlock myPassword321 --raw');
|
||||||
writeLn('', true);
|
writeLn('', true);
|
||||||
})
|
})
|
||||||
|
.option('--check', 'Check vault status.', async () => {
|
||||||
|
const locked = await this.main.lockService.isLocked();
|
||||||
|
if (!locked) {
|
||||||
|
const res = new MessageResponse('Vault is unlocked!', null);
|
||||||
|
this.processResponse(Response.success(res), true);
|
||||||
|
}
|
||||||
|
this.processResponse(Response.error('Vault is locked.'), true);
|
||||||
|
})
|
||||||
.action(async (password, cmd) => {
|
.action(async (password, cmd) => {
|
||||||
|
if (!cmd.check) {
|
||||||
await this.exitIfNotAuthed();
|
await this.exitIfNotAuthed();
|
||||||
const command = new UnlockCommand(this.main.cryptoService, this.main.userService,
|
const command = new UnlockCommand(this.main.cryptoService, this.main.userService,
|
||||||
this.main.cryptoFunctionService);
|
this.main.cryptoFunctionService);
|
||||||
const response = await command.run(password, cmd);
|
const response = await command.run(password, cmd);
|
||||||
this.processResponse(response);
|
this.processResponse(response);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
program
|
program
|
||||||
|
|||||||
Reference in New Issue
Block a user