11 lines
350 B
TypeScript
11 lines
350 B
TypeScript
import type { LoaderFunctionArgs } from "@remix-run/node";
|
|
import { redirect } from "@remix-run/node";
|
|
import { getUserId } from "~/utils/auth.server";
|
|
|
|
export const loader = async ({ request }: LoaderFunctionArgs) => {
|
|
const userId = await getUserId(request);
|
|
if (userId) {
|
|
return redirect("/dashboard");
|
|
}
|
|
return redirect("/signin");
|
|
}; |