DINO
Explore posts from serversHow do I implement API key authorization along with JWT authorization in tRPC?
Hello,
I want to make some routes protected and to be accessed by either JWT auth or by API keys auth. So I check both auth methods in the same context.
To make things clear i will just share the code of my
context
:
I am using Fastify.js. What do you think of this approach?
Thanks.2 replies
TTCTheo's Typesafe Cult
•Created by DINO on 7/17/2024 in #questions
Uploadthing error "An error occured while parsing input/output" when I try to upload with Insomnia
![No description](https://cdn.answeroverflow.com/1263051039389519973/image.png)
20 replies
Is to possible to update the trpc client url?
Hello,
I have create my trpc client this way:
Is there a way i can change the url in the httpBatchLink when the app is running? I tried to create and override the old instance but it didn't work.
Thanks.
2 replies
How do I set header value from localStorage or Zustand in tRPC and React?
Hello,
This is my tRPC client in my
App.tsx
:
The problem is if the jwt token changes, it doesn't get changed in the trpcClient unless I do something like this but I don't like it:
What is the best way to set jwt to trpc client?2 replies
What do you guys think about the approach of importing/exporting tRPC types to be used in separate B
Hello,
I was looking for a way to share tRPC API between multiple electron apps, I thought first about using a
Nx monorepo
but it turned out it's almost impossible to make it work with electron app that use electron-vite
.
After more research I found this repo: https://github.com/mkosir/trpc-api-boilerplate
What I understood from this approach is you export the types of the tRPC server with all db types from the backend repo and you import them in any other -frontend- repo using GitHub API (Octokit).
Is this approach common in general programming environments and what do you think about it?
Thanks.2 replies
useMutation() runs 3 times
Hello,
I have this weird problem that all my mutations across the app runs 3 times I don't know why.
This is my API in the backend:
And this is how I use them in the client:
I am sure that the call from the client doesn't run 3 times. I checked it with console.log.
I would be grateful if anyone helped. THanks.
14 replies