1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-17 00:33:44 +00:00

logout command

This commit is contained in:
Kyle Spearrin
2018-05-15 23:26:36 -04:00
parent 33effb1a4d
commit 6fff69c0ea
4 changed files with 47 additions and 9 deletions

View File

@@ -0,0 +1,17 @@
import * as program from 'commander';
import { AuthService } from 'jslib/abstractions/auth.service';
import { Response } from '../models/response';
import { MessageResponse } from '../models/response/messageResponse';
export class LogoutCommand {
constructor(private authService: AuthService, private logoutCallback: () => Promise<void>) { }
async run(cmd: program.Command) {
await this.logoutCallback();
this.authService.logOut(() => { /* Do nothing */ });
const res = new MessageResponse('You have logged out.', null);
return Response.success(res);
}
}