T
TanStack2mo ago
flat-fuchsia

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
absent-sapphire
absent-sapphire2mo ago
Have you already tried typing the {next, contex} object pair instead of leaving it untyped?
exotic-emerald
exotic-emerald2mo ago
you need to add middleware([authMiddlware]) to sidMiddlware
flat-fuchsia
flat-fuchsiaOP2mo ago
ah nice, thanks

Did you find this page helpful?