shellphone.app/app/routes/__auth/sign-out.tsx
2022-05-14 12:22:06 +02:00

10 lines
351 B
TypeScript

import type { LoaderFunction } from "@remix-run/node";
import authenticator from "~/utils/authenticator.server";
export const loader: LoaderFunction = async ({ request }) => {
const searchParams = new URL(request.url).searchParams;
const redirectTo = searchParams.get("redirectTo") ?? "/";
await authenticator.logout(request, { redirectTo });
};