-
Notifications
You must be signed in to change notification settings - Fork 402
feat(clerk-js): Add allowedRedirectProtocols #4705
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
Conversation
🦋 Changeset detectedLatest commit: dce268f The changes in this PR will be included in the next version bump. This PR includes changesets to release 22 packages
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 |
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
| * Note that this utility should **never** be called with a user-provided URL. We make no specific checks against the contents of the URL here and assume it is safe. Use `Clerk.navigate()` instead for user-provided URLs. | ||
| */ |
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 replace the usage for windowNavigate from SignIn.ts and SignUp.ts with Clerk.navigate() ?
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.
I don't think we need to, as the url is provided from our API and it will always be external.
Description
Introduce a new Clerk option,
allowedRedirectProtocolsthat allows users to specify custom protocols to be allowed as part of user-provided redirect URLs. This is necessary for cases where deep-linking is used, in an Electron app for example.As part of this, I've removed the protocol check from
windowNavigate. This is an internal method that is used in only a few places, none of which should be accepting arbitrary, user-provided URLs. I've also added a JSDoc comment indicatingwindowNavigateshould never be used when accepting user-provided URLs.fixes SDKI-782
Closes: #4667
Checklist
pnpm testruns as expected.pnpm buildruns as expected.Type of change