-
-
Notifications
You must be signed in to change notification settings - Fork 20
Description
Describe the bug
I have a middleware which will redirect to my OAuth API to handle the OAuth Flow.
But the redirect from the middleware will not lead to a change of the document url. The ClientProvider will fetch and follow the redirect until the url is not part of the domain and fail with a CORS policy error.
A solution might be to add a third parameter object to redirect() function to force the redirect to be done as a real location change in the browser by returning a redirect as a special rsc object which is interpreted by ClientProvider and issues a change of the location in the browser. The current problem comes from the fact that a real http redirect response object is issued and handled by the fetch request in ClientProvider.
Example:
redirect('/api/login',302,{force: 'native'})
The only working solution currently is not to replace the <Link> component with <a> tag which fixes some cases but not all.
Reproduction
No response
Steps to reproduce
No response
System Info
System:
OS: macOS 15.7.1
CPU: (12) arm64 Apple M4 Pro
Memory: 1.96 GB / 48.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 25.2.1 - /opt/homebrew/bin/node
npm: 11.6.2 - /opt/homebrew/bin/npm
pnpm: 10.22.0 - /opt/homebrew/bin/pnpm
Browsers:
Chrome: 142.0.7444.176
Safari: 26.0.1
npmPackages:
@lazarv/react-server: 0.0.0-experimental-600622d-20251109-6c5a6bee => 0.0.0-experimental-600622d-20251109-6c5a6beeUsed Package Manager
pnpm
Logs
No response
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion.
- The provided reproduction is a minimal reproducible example of the bug.