(opts: CreateNextContextOptions)
| 59 | * @see https://trpc.io/docs/context |
| 60 | */ |
| 61 | export const createTRPCContext = async (opts: CreateNextContextOptions) => { |
| 62 | const { req, res } = opts; |
| 63 | |
| 64 | // Get the session from the server using the getServerSession wrapper function |
| 65 | const session = await getServerAuthSession({ req, res }); |
| 66 | |
| 67 | return createInnerTRPCContext({ |
| 68 | session, |
| 69 | cookies: req.cookies, |
| 70 | }); |
| 71 | }; |
| 72 | |
| 73 | /** |
| 74 | * 2. INITIALIZATION |
nothing calls this directly
no test coverage detected