gitfoss-fork-fork | b2e159b5cacdc3e0b59a8cae72c39c8c74df11e0 | 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;