Skip to content

fix(auth): hide Turnstile widget container to prevent layout gap#3706

Merged
waleedlatif1 merged 1 commit intostagingfrom
fix/turnstile-layout
Mar 21, 2026
Merged

fix(auth): hide Turnstile widget container to prevent layout gap#3706
waleedlatif1 merged 1 commit intostagingfrom
fix/turnstile-layout

Conversation

@waleedlatif1
Copy link
Collaborator

@waleedlatif1 waleedlatif1 commented Mar 21, 2026

Summary

  • The invisible Turnstile iframe was rendering between the password field and submit button, creating a visible layout gap on both login and signup pages
  • Wrapped the Turnstile component in a hidden div so it doesn't affect layout flow

Test plan

  • Verify no gap between password field and submit button on login page
  • Verify no gap between password field and submit button on signup page
  • Verify Turnstile captcha still works (invisible challenge on submit)

@vercel
Copy link

vercel bot commented Mar 21, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped Mar 21, 2026 8:16pm

Request Review

@cursor
Copy link

cursor bot commented Mar 21, 2026

PR Summary

Low Risk
Low risk UI/layout-only change that only affects how the invisible Turnstile iframe is mounted on login/signup forms; captcha execution logic is unchanged.

Overview
Prevents a visible spacing gap in the auth forms by wrapping the invisible Cloudflare Turnstile widget in a zero-sized, overflow-hidden container.

Applies the same layout fix to both login-form.tsx and signup-form.tsx without altering the submit flow or captcha token handling.

Written by Cursor Bugbot for commit 9850cb3. Configure here.

The invisible Turnstile iframe was taking up space between the
password field and submit button. Wrapped in a hidden div.
@waleedlatif1
Copy link
Collaborator Author

@cursor review

@waleedlatif1
Copy link
Collaborator Author

@greptile

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Mar 21, 2026

Greptile Summary

This PR fixes a layout gap on the login and signup pages caused by Cloudflare Turnstile's invisible CAPTCHA iframe being rendered in the document flow, by wrapping the <Turnstile> component in a div with h-0 w-0 overflow-hidden Tailwind classes.

Key changes:

  • login-form.tsx and signup-form.tsx both wrap <Turnstile> in a zero-sized, overflow-hidden container so it occupies no visual space while remaining mounted in the DOM for CAPTCHA execution.

Notes:

  • Using h-0 w-0 overflow-hidden (rather than Tailwind's hidden / display:none) is the correct approach here — display:none could prevent the Turnstile iframe from initializing and running the invisible challenge, while the zero-sized container keeps the widget mounted and functional.
  • The fix is minimal, symmetric across both auth forms, and carries no risk to CAPTCHA functionality.

Confidence Score: 5/5

  • This PR is safe to merge — the change is a minimal, targeted CSS layout fix with no logic alterations.
  • The change is two identical, low-risk wrapping divs. The chosen approach (h-0 w-0 overflow-hidden rather than display:none) correctly preserves Turnstile widget initialization while eliminating the layout gap. No logic, state, or API interactions are modified.
  • No files require special attention.

Important Files Changed

Filename Overview
apps/sim/app/(auth)/login/login-form.tsx Wraps the invisible Turnstile component in a zero-sized h-0 w-0 overflow-hidden div to eliminate the layout gap between the password field and submit button.
apps/sim/app/(auth)/signup/signup-form.tsx Identical fix to login-form.tsx — wraps the invisible Turnstile widget in a zero-sized container to prevent the layout gap on the signup page.

Sequence Diagram

sequenceDiagram
    participant User
    participant Form as Login/Signup Form
    participant TurnstileDiv as div.h-0.w-0.overflow-hidden
    participant Turnstile as Turnstile Widget (invisible)
    participant Server as Auth Server

    User->>Form: Fill in credentials & submit
    Form->>Turnstile: turnstileRef.execute()
    Note over TurnstileDiv,Turnstile: Widget lives in zero-sized container,<br/>no layout impact but still in DOM
    Turnstile-->>Form: onSuccess(token)
    Form->>Server: POST /auth with token
    Server-->>Form: Auth response
    Form-->>User: Redirect / error message
Loading

Last reviewed commit: "fix(auth): hide Turn..."

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

@waleedlatif1 waleedlatif1 merged commit 506d382 into staging Mar 21, 2026
12 checks passed
@waleedlatif1 waleedlatif1 deleted the fix/turnstile-layout branch March 21, 2026 20:23
@waleedlatif1 waleedlatif1 restored the fix/turnstile-layout branch March 23, 2026 18:20
@waleedlatif1 waleedlatif1 deleted the fix/turnstile-layout branch March 24, 2026 02:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant