I can't figure out how to make an authentication middleware for my API please help
I'm using credentials provider with jwt from nextauth and then I have a middleware.ts in the root folder with just this content
which works if I pass static pages on the matcher but It doesn't work for the api. I've also tried to make a wrapper middleware returning an async function inside sort of but I get something like resolver is not defined so how can I make just a simple middleware that checks if the user is logged in on the backend? I've tried lots of tutorials and read the docs too and I can't make it work. 😦
Can I get some help or at least get pointed in the right direction?
2 Replies
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
I think that'll do it tnak you very much