The application is using getLoadContext which gets the user and creates an api client bound to the current user. This api client, fetchTyped
, wraps the native fetch
function and will automatically include the jwt token stored in the session for that request. It also accepts a zod schema to validate the returned json. This is located on the app context object that can be retrieved in actions and loaders.
export async function loader({ context }: Route.LoaderArgs) {
const ctx = getAppContext(context)