9 lines
328 B
TypeScript
9 lines
328 B
TypeScript
import type { LoaderFunctionArgs } from "react-router";
|
|
import { redirect } from "react-router";
|
|
|
|
export const loader = async ({ request }: LoaderFunctionArgs) => {
|
|
const url = new URL(request.url);
|
|
if (url.searchParams.get("shop")) throw redirect(`/app?${url.searchParams.toString()}`);
|
|
throw redirect("/auth/login");
|
|
};
|