mirror of
https://github.com/webstudio-is/webstudio.git
synced 2026-11-09 14:03:33 +09:00
Here replaced LoaderArgs and ActionArgs with LoaderFunctionArgs and ActionFunctionArgs to simplify bump with remix v2 which changed named of these types.
14 lines
493 B
TypeScript
14 lines
493 B
TypeScript
import type { LoaderFunctionArgs } from "@remix-run/server-runtime";
|
|
import { authenticator } from "~/services/auth.server";
|
|
import { loginPath } from "~/shared/router-utils";
|
|
import { returnToPath } from "~/services/cookie.server";
|
|
|
|
export const loader = async ({ request }: LoaderFunctionArgs) => {
|
|
const returnTo = await returnToPath(request);
|
|
|
|
return authenticator.authenticate("google", request, {
|
|
successRedirect: returnTo,
|
|
failureRedirect: loginPath({ returnTo }),
|
|
});
|
|
};
|