Relative Content

Tag Archive for authenticationmiddlewarenext-authresponse.redirectnextjs14

Middleware in Next.js Only Works for the First Request from Client-Side Navigation

I’m working with Next.js and facing an issue where middleware is not being triggered on subsequent navigations from a client-side route. Specifically, I’m using router.push in a React component with use client, but it seems that the middleware only performs its check on the first request and does not re-evaluate subsequent navigations. (NextJS 14)