diff --git a/src/program.ts b/src/program.ts index b284f3a1eb8..20df039aaea 100644 --- a/src/program.ts +++ b/src/program.ts @@ -92,6 +92,14 @@ export class Program { .description('Log into a user account.') .option('--method ', 'Two-step login method.') .option('--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('');