Hi, I have a route handler to handle login. When user calls this endpoint, I expect to redirect them to a different page. However, when I use redirect or NextResponse.redirect, the redirecting does not work.
I follow this section: https://nextjs.org/docs/app/building-your-application/routing/route-handlers#redirects
I have included a photo of the network tab. I still receive a 307 response in frontend and the whole page load but the UI is not changing.
I have tried using form action and client event handler but no luck so far
Here is a repo I use to recreate this behavior: https://github.com/trungne/nextjs-route-handler-redirect
Not sure if I understand the docs correctly but I would expect the UI to be redirected to a new page when I perform redirect in a route handler.
Any help is appreciated. Thanks!