({ request }: LoaderFunctionArgs)
| 37 | }; |
| 38 | |
| 39 | export const loader = async ({ request }: LoaderFunctionArgs) => { |
| 40 | const session = await getSession(request.headers.get("cookie")); |
| 41 | const toastMessage = session.get("toastMessage") as ToastMessage; |
| 42 | const posthogProjectKey = env.POSTHOG_PROJECT_KEY; |
| 43 | const highlightProjectId = env.HIGHLIGHT_PROJECT_ID; |
| 44 | const features = featuresForRequest(request); |
| 45 | |
| 46 | return typedjson( |
| 47 | { |
| 48 | user: await getUser(request), |
| 49 | toastMessage, |
| 50 | posthogProjectKey, |
| 51 | highlightProjectId, |
| 52 | features, |
| 53 | appEnv: env.APP_ENV, |
| 54 | appOrigin: env.APP_ORIGIN, |
| 55 | }, |
| 56 | { headers: { "Set-Cookie": await commitSession(session) } } |
| 57 | ); |
| 58 | }; |
| 59 | |
| 60 | export type LoaderType = typeof loader; |
| 61 |
nothing calls this directly
no test coverage detected
searching dependent graphs…