Creaete T3 No Req or Res in TRPC context
I am trying to integrate clerk with the trpc create context, but the createContext generated by create-3t isn't passing the req or res of the request.
What can I do?
5 Replies
specifically here, there is no mention of req or res.
What am I doing wrong here?
This is the server/trpc.ts and dont modify the react.tsx & server.ts in the trpc folder. I assume you wanted the auth data inside TRPC context.
@Sugan_Selvam Yes, but when I do this, I need req/res in order to find the auth, right?
No, Thats not required anymore for the TRPC context. May i ask where you are trying to find the auth? a sample path or code stub would be helpful to answer.
@DangerZone, you're most likely importing the
getAuth
function instead of auth
function. Use the auth function, just like @Sugan_Selvam did in their screenshot. DocsNext.js: auth()
Access minimal authentication data for managing sessions and data fetching.