1
0
mirror of https://github.com/bitwarden/directory-connector synced 2026-01-20 17:33:36 +00:00
Files
directory-connector/src/commands/logout.command.ts
Thomas Rittson 4652c6489f [AC-3043] Refactor AuthService to only use organization api key login (#622)
* Remove jslib authService and unused loginStrategies

* Delete KeyConnectorService

* Move OrganizationLoginStrategy into base LoginStrategy

* Remove unused code and services from loginStrategy

* Delete OrganizationService

* Move loginStrategy into authService
2024-09-23 08:46:38 +10:00

22 lines
578 B
TypeScript

import { Response } from "@/jslib/node/src/cli/models/response";
import { MessageResponse } from "@/jslib/node/src/cli/models/response/messageResponse";
import { AuthService } from "../abstractions/auth.service";
export class LogoutCommand {
constructor(
private authService: AuthService,
private logoutCallback: () => Promise<void>,
) {}
async run() {
await this.logoutCallback();
this.authService.logOut(() => {
/* Do nothing */
});
const res = new MessageResponse("You have logged out.", null);
return Response.success(res);
}
}