Skip to content

Commit 980b8b6

Browse files
waleedlatif1claude
andcommitted
fix(landing): force login view when registration is disabled
When a CTA passes defaultView='signup' but registration is disabled, the modal now opens in login mode instead of showing "Create free account" with social buttons that would fail on the backend. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 6e47dd0 commit 980b8b6

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

apps/sim/app/(landing)/components/auth-modal/auth-modal.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,12 @@ export function AuthModal({ children, defaultView = 'login', source }: AuthModal
9191
}
9292
setOpen(nextOpen)
9393
if (nextOpen) {
94-
setView(defaultView)
95-
captureClientEvent('auth_modal_opened', { view: defaultView, source })
94+
const initialView =
95+
defaultView === 'signup' && providerStatus?.registrationDisabled
96+
? 'login'
97+
: defaultView
98+
setView(initialView)
99+
captureClientEvent('auth_modal_opened', { view: initialView, source })
96100
}
97101
},
98102
[defaultView, hasModalContent, providerStatus, router, source]

0 commit comments

Comments
 (0)