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"; | |
| Team plan, an open-source pool, monthly trials and honest metering; the sidebar for everyone; a workspace that stays put | 4 | import { assertSameOrigin, endSession, nextPath } from "../lib/session.server"; |
| Initial g1t: services, event bus, intents and attempts | 5 | |
| Team plan, an open-source pool, monthly trials and honest metering; the sidebar for everyone; a workspace that stays put | 6 | /** |
| 7 | * Signs out, then goes home, or to `next` (a path on g1t only): "Switch | |
| 8 | * account" signs out to the sign-in page, which brings them back. | |
| 9 | */ | |
| Initial g1t: services, event bus, intents and attempts | 10 | export async function action({ request }: Route.ActionArgs) { |
| 11 | assertSameOrigin(request); | |
| Team plan, an open-source pool, monthly trials and honest metering; the sidebar for everyone; a workspace that stays put | 12 | throw redirect(nextPath(request), { |
| Initial g1t: services, event bus, intents and attempts | 13 | headers: { "set-cookie": await endSession(request) }, |
| 14 | }); | |
| 15 | } | |
| 16 | ||
| 17 | export function loader() { | |
| 18 | throw redirect("/"); | |
| 19 | } |