UNPKG

create-better-t-stack

Version:

A modern CLI tool for scaffolding end-to-end type-safe TypeScript projects with best practices and customizable configurations

19 lines (14 loc) 410 B
import type { Context as HonoContext } from "hono"; import { auth } from "./auth"; export type CreateContextOptions = { context: HonoContext; }; export async function createContext({ context }: CreateContextOptions) { const session = await auth.api.getSession({ headers: context.req.raw.headers, }); return { session, }; } export type Context = Awaited<ReturnType<typeof createContext>>;