gitfoss-fork-fork | 946986ceca2b037956065539e094d386d74b2d7a | app/controllers/auth/getLogoutAction.ts ∙ GitFOSS
.ts
TypeScript
(application/typescript)
// 3rd-party
import type { ReqHandler } from "@ethicdevs/react-monolith";
// app
import { AppRoute } from "../../routes";

const getLogoutAction: ReqHandler = async (request, reply) => {
  await request.session.destroy();
  reply.redirect(request.namedViewsPathMap[AppRoute.HOME]);
  return reply;
};

export default getLogoutAction;