feat(clerk-js): Backport interactive captcha spotlight for Core 2#8935
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
🦋 Changeset detectedLatest commit: cc5f7ff The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 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 |
Set a data-cl-interactive signal on the captcha element when a Turnstile challenge becomes interactive, and spotlight it during sign-in/sign-up by collapsing and inerting the rest of the start card until it is solved.
d1989d6 to
cc5f7ff
Compare
|
!snapshot |
|
Hey @anagstef - the snapshot version command generated the following package versions:
Tip: Use the snippet copy button below to quickly install the required packages. npm i @clerk/chrome-extension@2.9.19-snapshot.v20260619160001 --save-exact
npm i @clerk/clerk-js@5.126.0-snapshot.v20260619160001 --save-exact
npm i @clerk/clerk-expo@2.19.40-snapshot.v20260619160001 --save-exact |
Backports the interactive-captcha spotlight from #8907 to the Core 2 release line.
There is no
@clerk/uipackage in Core 2 — the sign-in/sign-up UI lives entirely insideclerk-js(packages/clerk-js/src/ui). So the UI changes from the original PR are applied directly to clerk-js's bundled components here, alongside the clerk-js runtime change.What it does
When a Cloudflare Turnstile challenge escalates to an interactive "Verify you are human" check, the start card brings it to the foreground: the rest of the card (social buttons, form) collapses and is
inert-ed until the challenge is solved, while the header, footer, and passkey action stay reachable. Invisible challenges — the vast majority — are unaffected.Changes
utils/captcha/turnstile.ts— sets adata-cl-interactiveattribute on#clerk-captchawhen a challenge becomes interactive (removed on resolve), giving the UI a reliable signal.ui/elements/CaptchaElement.tsx— new optionalonInteractiveChangeandgaplessprops; the MutationObserver now also readsdata-cl-interactive, with amaxHeightfallback for older runtimes. Other render sites that use a bare<CaptchaElement />are unaffected.ui/components/SignIn/SignInStart.tsxandui/components/SignUp/SignUpStart.tsx— hoist the captcha into a single slot outside the collapsing column and wire up the spotlight.ui/components/SignUp/SignUpForm.tsx— no longer renders its own captcha; the start card's slot owns it now.Note
SignUpFormis shared by the start and continue flows, so removing its captcha meansSignUpContinueno longer renders a captcha element. This matches the original PR's behavior — the captcha is only needed on the initial sign-up create.