mirror of
https://github.com/bitwarden/browser
synced 2025-12-17 00:33:44 +00:00
logout command
This commit is contained in:
17
src/commands/logout.command.ts
Normal file
17
src/commands/logout.command.ts
Normal 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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user