Dinuma
Help Retrieving req.url from opts in useMutation from tRPC
Hello, i'm trying to essentially send a magiclink email using supabase client libraries, however, i'm running into an issue of not being able to retrieve the req.url (in order to get the baseURL). I would prefer not to hard-code it due to changing addresses between localhost, Vercel Preview Branches, Primary Domain.
Code Context
I believe the way to go here is to utilize a context, however, i'm having trouble setting that up throughout the react-query client portion alongside with the server portion.
My current repo is 1:1 to jherr's nextjs App Router setup, except it has this auth router composing into the primary appRouter.
https://github.com/jherr/trpc-on-the-app-router/tree/main/src/app
I'm confused on how to override the fetchRouterHandler on the client side to properly pass through the req / res object.
Attempt at making the context
4 replies