-
Notifications
You must be signed in to change notification settings - Fork 389
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
Add support for customizing returnTo in middleware #1342
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Ignored Deployment
|
Co-authored-by: Rita Zerrizuela <[email protected]>
const { pathname, origin, search } = req.nextUrl; | ||
let returnTo = `${pathname}${search}`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we include the basePath
here? As requested in #1329
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or maybe in another PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reason I didn't add it was because I was worried it might be a breaking change.
If you were to work around this limitation currently, you might write something that prepended the base path to the returnTo
in a custom login or callback handler and I didn't want to break that usage.
Deployment failed with the following error:
|
📋 Changes
Adding support for customizing the
returnTo
in middleware:📎 References
fixes #1322 #1329