-
Notifications
You must be signed in to change notification settings - Fork 295
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
feat(nextjs): Accept redirectUrl
as option for auth().protect()
#2329
Conversation
🦋 Changeset detectedLatest commit: 6ccbdff The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
@brkalow @nikosdouvlis Do you find this too annoying ? Types for params are already too complex. auth().protect(undefined, { redirectUrl:'/any-page' }) |
Avoid merging before the question above is answered |
@panteliselef Is the alternative to adjust the types such that this is possible? auth().protect({ redirectUrl: '/' }) I think I prefer this. ☝️ It feels like we're trying to dissuade people from using the option if they need to do this for the authn scenario: auth().protect(undefined, { redirectUrl: '/' }) |
…arameter"" This reverts commit 2b0f942.
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.
👏
Description
This PR allows developers to call
auth().protect()
and pass to it aredirectUrl
which can be used as the fallback instead of the standard 404 error that we currently throw.Checklist
npm test
runs as expected.npm run build
runs as expected.Type of change
Packages affected
@clerk/backend
@clerk/chrome-extension
@clerk/clerk-js
@clerk/clerk-expo
@clerk/fastify
gatsby-plugin-clerk
@clerk/localizations
@clerk/nextjs
@clerk/clerk-react
@clerk/remix
@clerk/clerk-sdk-node
@clerk/shared
@clerk/themes
@clerk/types
build/tooling/chore