1
0
mirror of https://github.com/bitwarden/browser synced 2024-12-11 16:55:56 +01:00

add login check option (#47)

This commit is contained in:
Estelle Poulin 2019-01-15 11:46:58 -05:00 committed by Kyle Spearrin
parent 80bb03de91
commit 22062cc9f6

View File

@ -92,6 +92,14 @@ export class Program {
.description('Log into a user account.') .description('Log into a user account.')
.option('--method <method>', 'Two-step login method.') .option('--method <method>', 'Two-step login method.')
.option('--code <code>', 'Two-step login code.') .option('--code <code>', 'Two-step login code.')
.option('--check', 'Check login status.', async () => {
const authed = await this.main.userService.isAuthenticated();
if (authed) {
const res = new StringResponse('You are logged in!');
this.processResponse(Response.success(res), true);
}
this.processResponse(Response.error('You are not logged in.'), true);
})
.on('--help', () => { .on('--help', () => {
writeLn('\n Notes:'); writeLn('\n Notes:');
writeLn(''); writeLn('');