bitwarden-estensione-browser/src/commands/lock.command.ts

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

18 lines
585 B
TypeScript
Raw Normal View History

2018-05-16 16:25:25 +02:00
import * as program from "commander";
import { VaultTimeoutService } from "jslib-common/abstractions/vaultTimeout.service";
2018-05-16 16:25:25 +02:00
import { Response } from "jslib-node/cli/models/response";
import { MessageResponse } from "jslib-node/cli/models/response/messageResponse";
2018-05-16 16:25:25 +02:00
export class LockCommand {
constructor(private vaultTimeoutService: VaultTimeoutService) {}
2018-05-16 16:25:25 +02:00
async run(cmd: program.Command) {
await this.vaultTimeoutService.lock();
2018-05-16 16:25:25 +02:00
process.env.BW_SESSION = null;
const res = new MessageResponse("Your vault is locked.", null);
return Response.success(res);
}
}