mirror of
https://github.com/bitwarden/clients.git
synced 2026-07-10 21:03:56 +08:00
22 lines
597 B
TypeScript
22 lines
597 B
TypeScript
import * as program from 'commander';
|
|
|
|
import { AuthResult } from 'jslib/models/domain/authResult';
|
|
|
|
import { AuthService } from 'jslib/abstractions/auth.service';
|
|
|
|
import { Response } from '../models/response';
|
|
|
|
export class LoginCommand {
|
|
constructor(private authService: AuthService) { }
|
|
|
|
async run(email: string, password: string, cmd: program.Command) {
|
|
try {
|
|
const result = await this.authService.logIn(email, password);
|
|
// TODO: 2FA
|
|
return Response.success();
|
|
} catch (e) {
|
|
return Response.error(e);
|
|
}
|
|
}
|
|
}
|