trpc pipe middleware
Hey all.
I'm currently trying to create a middle ware on endpoints using the new
pipe
API.
This is on a specific route which is formatted like:
http://localhost:3000/dashboard/811452295324762131/page
Is it possible to retrieve the dynamic id
which is in this URL, in my middleware? I really need to access this for the middleware to be possible to use.
Essentially I need to check if the current user has permission to access this guildId.
There unfortunetly doesn't seem to be any req
property in the pipe api which could give me router information.N
Nick•381d ago
Middlewares can use context, so you can put this data in context first
N
Nick•381d ago
Context | tRPC
Your context holds data that all of your tRPC procedures will have access to, and is a great place to put things like database connections or authentication information.
R
rustclan•380d ago
Thank you! I found a way to do this which was using
rawInput
prop, but shall give this a read too.4.8KMembers
View on DiscordMore Posts
Has anyone ever used tRPC (with SSR) and i18n?No matter the lib (next-intl, next-i18n, next-translate), I simply stumble from one problem to anothNew to tRPC and Need Help with BasicsI made a new T3 app, but I don't quite understand how tRPC works, and I would love to get some help web socket keeps on disconnecting and connectingHi! Its my first time using web sockets. The first code snippet is my socket code. The second code sPagination QueryHi, I'm new for web dev and I'm moved to tRPC not so long
I'm looking for example of pagination quEnrich the response object for TRPC endpointCurrently when I hit a trpc endpoint I get something like:
```typescript
{
result: {
data:Can i fetch tRPC in different project@coco- : I Make a tRPC in my project. Can I use the enpoint api in different project ?Importing AppRouter types from an external repoI've got a production T3 app already in production. I've created a fresh expo app to start building TypeScript type for request object for route handlersSo far I've been writing my routes like:
```typescript
export const router = t.router({
helloWorl