Add sso-callback step to fix Clerk Smart CAPTCHA initialization error #2164
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Resolved the issue where the Clerk Smart CAPTCHA widget fails to initialize due to the missing
clerk-captcha
DOM element, causing a fallback to Invisible CAPTCHA. The error stemmed from the custom sign-in form example in Clerk's shadcn-ui documentation lacking the<SignIn.Captcha />
component. Added aSignIn.Step
namedsso-callback
with the<SignIn.Captcha />
component to the sign-in flow, ensuring proper initialization of the Smart CAPTCHA widget.🔎 Previews:
What does this solve?
<SignIn.Captcha />
component in the example provided at Clerk's shadcn-ui documentation. Without this component, users encountered the error:Cannot initialize Smart CAPTCHA widget because the clerk-captcha DOM element was not found; falling back to Invisible CAPTCHA widget
. This change ensures a smoother and intended authentication experience.What changed?
<SignIn.Step name="sso-callback">
to the sign-in flow, including the<SignIn.Captcha />
component and a submit action. This step prompts users to complete the CAPTCHA verification, allowing the Smart CAPTCHA widget to initialize properly and preventing the fallback to Invisible CAPTCHA. The updated code integrates seamlessly with the existing shadcn-ui based sign-in form structure.Checklist