The middleware component of the issue tracker seems to work fine except in one spot. I’m not sure if it broke when I added the “Assign User” components or it was broken from before.
In my middleware component, I have the following:
export {default} from 'next-auth/middleware'
export const config = {
matcher: [
'/issues/new',
'/issues/edit/:id+',
]
}
``
When I am not logged in, all works perfectly. But when I am logged in, the /issues/new page keeps pushing me back to the login page, even though I am already logged in. No matter what it always goes back to login. Refresh/restart - nothing seems to fix it.
I tried it with a trailing slash: /issues/new/ and without /issues/new. It just never realizes I am logged in. But only on that page.
If I remove that line from the middleware, the form works fine. It's all related to the next-auth and middleware component.
The /issues/edit/ page works as it should. If logged in, it works. If logged out, it goes to sign-in.