mirror of
https://github.com/bitwarden/browser.git
synced 2024-11-23 11:56:00 +01:00
add login check option (#47)
This commit is contained in:
parent
80bb03de91
commit
22062cc9f6
@ -92,6 +92,14 @@ export class Program {
|
||||
.description('Log into a user account.')
|
||||
.option('--method <method>', 'Two-step login method.')
|
||||
.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', () => {
|
||||
writeLn('\n Notes:');
|
||||
writeLn('');
|
||||
|
Loading…
Reference in New Issue
Block a user