Skip to content

Commit f71e2c5

Browse files
waleedlatif1claude
andcommitted
fix(landing): strip isProduction from provider response and handle late-resolve redirect
- Destructure only githubAvailable/googleAvailable from getOAuthProviderStatus so isProduction is not leaked to unauthenticated callers. - Add useEffect to redirect away from the modal if provider status resolves after the modal is already open and no social providers are configured. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent ba1c300 commit f71e2c5

2 files changed

Lines changed: 9 additions & 2 deletions

File tree

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,13 @@ export function AuthModal({ children, defaultView = 'login', source }: AuthModal
6969

7070
const hasSocial = providerStatus?.githubAvailable || providerStatus?.googleAvailable
7171

72+
useEffect(() => {
73+
if (open && providerStatus && !hasSocial) {
74+
setOpen(false)
75+
router.push(defaultView === 'login' ? '/login' : '/signup')
76+
}
77+
}, [open, providerStatus, hasSocial, defaultView, router])
78+
7279
const handleOpenChange = useCallback(
7380
(nextOpen: boolean) => {
7481
if (nextOpen && providerStatus && !hasSocial) {

apps/sim/app/api/auth/providers/route.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ import { getOAuthProviderStatus } from '@/app/(auth)/components/oauth-provider-c
44
export const dynamic = 'force-dynamic'
55

66
export async function GET() {
7-
const status = await getOAuthProviderStatus()
8-
return NextResponse.json(status)
7+
const { githubAvailable, googleAvailable } = await getOAuthProviderStatus()
8+
return NextResponse.json({ githubAvailable, googleAvailable })
99
}

0 commit comments

Comments
 (0)