mirror of
https://github.com/bitwarden/browser
synced 2025-12-17 08:43:33 +00:00
lock/unlock commands
This commit is contained in:
17
src/commands/lock.command.ts
Normal file
17
src/commands/lock.command.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import * as program from 'commander';
|
||||
|
||||
import { LockService } from 'jslib/abstractions/lock.service';
|
||||
|
||||
import { Response } from '../models/response';
|
||||
import { MessageResponse } from '../models/response/messageResponse';
|
||||
|
||||
export class LockCommand {
|
||||
constructor(private lockService: LockService) { }
|
||||
|
||||
async run(cmd: program.Command) {
|
||||
await this.lockService.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