ihrishi
ihrishi
TTCTheo's Typesafe Cult
Created by nico on 2/1/2024 in #questions
Integrating Clerk: How to supply req to createTRPCContext on server-side?
from what i understand, getAuth() is for pages router. I used auth() and it seems to working fine for me.
export const createTRPCContext = async (opts: { headers: Headers }) => {
const session = auth();
return {
db,
session,
...opts,
};
};
export const createTRPCContext = async (opts: { headers: Headers }) => {
const session = auth();
return {
db,
session,
...opts,
};
};
6 replies