jaiv
jaiv2y ago

Can you chain middlewares in v10?

Would I be able to make a rate limit and isAuthed middleware, then put queries behind both middlewares so it's rate limited and protected by auth? The docs suggest it doesn't work like this, but I wanted to make sure.
4 Replies
jaiv
jaiv2y ago
GitHub
Context swapping with multiple middlewares · Discussion #2770 · trp...
Hi there, I am currently using middleware context swapping for authentication and this works great so far. However, I was wondering if it would be possible to have the expected context swapping wor...
jaiv
jaiv2y ago
very cool
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
jaiv
jaiv2y ago
you still get access to a typed context in middlewares? its also not that bad, if you want middlewares shared by all procedures just add all of them to one procedure that you use by default, use a raw procedure if you need more customization. i use a ratelimited procedure by default and if i dont want it i use the normal one