Added a hook for appOrigin

This commit is contained in:
James Ritchie
2023-06-29 14:34:33 +01:00
parent 496dadebbd
commit b89a68bb9c
2 changed files with 9 additions and 0 deletions
+8
View File
@@ -0,0 +1,8 @@
import { useTypedRouteLoaderData } from "remix-typedjson";
import { loader } from "../root";
export function useAppOrigin() {
const routeMatch = useTypedRouteLoaderData<typeof loader>("root");
return routeMatch!.appOrigin;
}
+1
View File
@@ -55,6 +55,7 @@ export const loader = async ({ request }: LoaderArgs) => {
posthogProjectKey,
features,
appEnv: env.APP_ENV,
appOrigin: env.APP_ORIGIN,
},
{ headers: { "Set-Cookie": await commitSession(session) } }
);