Krishna
Integrating tRPC with Clerk Authentication in an Existing Next.js "Turborepo" Project
tRPC handles authentication at routes level with a middleware & hence is not married to any specific auth system. You can check an implementation here. Check the
isAuthed
& isTeziAdmin
middlewares here.
https://github.com/krishna-404/subs-manager/blob/main/apps/api/src/trpc/index.ts2 replies
Help understanding how to deploy tRPC in monorepo.
Yes you can deploy the fe & be separately…
You can checkout this template for pointers
https://github.com/teziapp/node-react-vite-trpc-pwa-turbo-monorepo
2 replies
onSuccess invalidate
I dont know how
invalidate
works... but Im pretty sure the assumption is flawed...
you can use useQuery
& call the refetch
property within it on update of posts...
better would be to use query-keys
within usequery
which would trigger a fresh refetch
automatically12 replies
Why my Authorization does not update ?
I think you are storing the token in a cookie... why not pick it from there?
If you dont want to store it in a cookie for some reason... store it in localstorage / sessioinstorage....
or store it in a globabl-state like Recoil.
here you seem to be using variables to store values... the variables deem to reset on re-mount of the component....
4 replies