T
TanStack6mo ago
ambitious-aqua

How do I read context in middleware?

Hi all, I have a middleware function in which I want to read the contents of 'context' to determine if I need to do something or not. Like the screenshot shows, context is of type 'never' but when I console.log the context out, I do see some values. How should I do this?
No description
3 Replies
generous-apricot
generous-apricot6mo ago
Have you already tried typing the {next, contex} object pair instead of leaving it untyped?
like-gold
like-gold6mo ago
you need to add middleware([authMiddlware]) to sidMiddlware
ambitious-aqua
ambitious-aquaOP5mo ago
ah nice, thanks

Did you find this page helpful?