New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Middleware query params functionality is broken #32480
Comments
I'm experiencing the same issue with the exact same behaviour. |
is this being tracked? I mean, the official example is broken for over a month now. any information from the team will be helpful for us to plan our next tasks |
Same here, with a slightly different use case--I'm using middleware to redirect some requests to an external site, and the query params that the middleware receives are being attached to the external redirect target. Seems potentially pretty dangerous 😬 |
This is now supported! You can remove query string parameters filtering them out with the |
@javivelasco I believe this case was specifically for redirects, not rewrites. I have verified that the issue has not been resolved. I can repro only when deployed to Vercel, and not when running locally. It maybe a vercel bug and not a next.js bug. Here's a repro: https://next-middleware-redirects.vercel.app/ Code: https://github.com/bryanrsmith/next-middleware-redirects |
@javivelasco There is still a problem here--see repro above. Would you like me to create a separate issue? |
Yes, please open a separate issue, we appreciate it! 🙏 |
This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
What version of Next.js are you using?
12.0.7
What version of Node.js are you using?
16.13.1
What browser are you using?
Chrome
What operating system are you using?
macOS
How are you deploying your application?
Vercel
Describe the Bug
We've been keeping an eye on the middleware functionality since the launch of v12. one use case we are interested in, is to authenticate users via magic links. While we can achieve this functionality, when we want to remove the token from url, we are getting errors due to infinite redirections. token is not being removed and the same thing is called over and over again until the function crashes.
others and us also saw this on examples provided by Vercel
Expected Behavior
we expect the functionality to work as described here
To Reproduce
visit this url
The text was updated successfully, but these errors were encountered: