1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-09-19 02:51:14 +02: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.')
.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('');