shellphone.app/app/routes/__auth/sign-out.tsx

10 lines
351 B
TypeScript
Raw Normal View History

2022-05-14 10:22:06 +00:00
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 });
};