-
Notifications
You must be signed in to change notification settings - Fork 252
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(clerk-js): Improve redirects on OAuth callback #1563
feat(clerk-js): Improve redirects on OAuth callback #1563
Conversation
🦋 Changeset detectedLatest commit: fae3436 The changes in this PR will be included in the next version bump. This PR includes changesets to release 12 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 |
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.
✅ Great news! Jit hasn't found any security issues in your PR. Good Job! 🏆
349a4cd
to
de7fbd7
Compare
Currently, if you try to sign up with a provider that allows unverified accounts, the flow appears to be broken because it asks for the email after the OAuth callback. With this change, it will navigate to the appropriate change when needed.
de7fbd7
to
c596cf9
Compare
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.
Nice work @kostaspt .
Added a comment to reduce the changes on this PR, so that FE folks can review it easier and spot any important issues.
/** | ||
* Full URL or path to navigate after requesting phone verification. | ||
*/ | ||
verifyPhoneNumberUrl?: string | null; |
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.
❓ Are these required for this fix? Seems like this is a broader API change for our components.
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.
It shouldn't need these, but for sign-in, using a relative URL won't work.
I want to redirect in these two cases:
sign-up/sso-callback
->sign-up/verify-email-address
sign-in/sso-callback
->sign-up/verify-email-address
For the first one to work, a relative URL like ../verify-email-address
is working as expected, but for the second one, the hash router will be necessary to navigate here.
Or I might be possibly missing something.
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 see, thanks for explaining. I guess the problem is the the transfer flow from sign in?
We are on the sign-in/
"base" path and we're mounting components in there. Wonder if there's an alternative where we always go through sign-up/
first or we can somehow reuse the signUpUrl
. I'll leave this comment open to get feedback from an expert in our javascript repo. 🙏
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.
Hello everyone, is there a design document explaining the changes proposed here?
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.
Hey @nikosdouvlis, there is no design document for this, but there is more information about the goal of this task in the ticket: https://linear.app/clerk/issue/USR-248
Do you have any concerns about these changes?
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.
Nice work @kostaspt , thank you for addressing my comments. 🚀
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.
This is actually a good example of when we should add an E2E test. (cc @nikosdouvlis)
…email-from-oauth-trigger-psu-redirects
This PR has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Type of change
Packages affected
@clerk/clerk-js
@clerk/clerk-react
@clerk/nextjs
@clerk/remix
@clerk/types
@clerk/themes
@clerk/localizations
@clerk/clerk-expo
@clerk/backend
@clerk/clerk-sdk-node
@clerk/shared
@clerk/fastify
@clerk/chrome-extension
gatsby-plugin-clerk
build/tooling/chore
Description
npm test
runs as expected.npm run build
runs as expected.Currently, if you try to sign up with a provider that allows unverified accounts, the flow appears to be broken because it asks for the email after the OAuth callback. With this change, it will navigate to the appropriate change when needed.
Before
Kapture.2023-08-08.at.17.47.29.mp4
After
Kapture.2023-08-08.at.18.33.04.mp4