I added `middleware.ts` to my NextJS NextAuth project and it's not working
Answered
Transvaal lion posted this in #help-forum
Transvaal lionOP
Am I not supposed to get redirected to the sign in page with these lines of code? I'm not sure why it's not redirecting me.
middleware.tsexport { default } from "next-auth/middleware"
export const config = { matcher: ["/"] }Answered by Transvaal lion
You're supposed to put the
middleware.ts under the src folder. I was putting it in the wrong place. Now it's working.1 Reply
Transvaal lionOP
You're supposed to put the
middleware.ts under the src folder. I was putting it in the wrong place. Now it's working.Answer