g1t/apps/web/app/routes/logout.tsx
Pick any line to see why it is the way it is: the commit, the pull request and issue it came from, and what the agent was thinking.
| Initial g1t: services, event bus, intents and attempts | 1 | import { redirect } from "react-router"; |
| 2 | ||
| 3 | import type { Route } from "./+types/logout"; | |
| 4 | import { assertSameOrigin, endSession } from "../lib/session.server"; | |
| 5 | ||
| 6 | export async function action({ request }: Route.ActionArgs) { | |
| 7 | assertSameOrigin(request); | |
| 8 | throw redirect("/", { | |
| 9 | headers: { "set-cookie": await endSession(request) }, | |
| 10 | }); | |
| 11 | } | |
| 12 | ||
| 13 | export function loader() { | |
| 14 | throw redirect("/"); | |
| 15 | } |