The issue was caused by the x-middleware-next header in Next.js, which prevented the flow from being interrupted properly.
As a result, redirects did not function correctly in certain cases.
This fix ensures that the flow is correctly interrupted, allowing redirects to work as expected.
Testing Details
[ ] Unit Test Added
[x] Manual Test/Other (Please elaborate)
Types of changes
[x] Bug fix (non-breaking change which fixes an issue)
[ ] New feature (non-breaking change which adds functionality)
[ ] Breaking change (fix or feature that would cause existing functionality to change)
Description / Motivation
The issue was caused by the x-middleware-next header in Next.js, which prevented the flow from being interrupted properly. As a result, redirects did not function correctly in certain cases. This fix ensures that the flow is correctly interrupted, allowing redirects to work as expected.
Testing Details
Types of changes