mirror of
https://github.com/bitwarden/browser
synced 2025-12-17 16:53:34 +00:00
Move CLI to apps/cli
This commit is contained in:
14
apps/cli/src/commands/lock.command.ts
Normal file
14
apps/cli/src/commands/lock.command.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
import { VaultTimeoutService } from "jslib-common/abstractions/vaultTimeout.service";
|
||||
import { Response } from "jslib-node/cli/models/response";
|
||||
import { MessageResponse } from "jslib-node/cli/models/response/messageResponse";
|
||||
|
||||
export class LockCommand {
|
||||
constructor(private vaultTimeoutService: VaultTimeoutService) {}
|
||||
|
||||
async run() {
|
||||
await this.vaultTimeoutService.lock();
|
||||
process.env.BW_SESSION = null;
|
||||
const res = new MessageResponse("Your vault is locked.", null);
|
||||
return Response.success(res);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user