refactor(auth): drop the isProduction prop nothing on the signin path reads

Same shape as the `isWorkflowRunning` removal: declared, required, threaded
through every layer, and never read at the end of the chain.

`SocialLoginButtons` declares `isProduction: boolean` as a REQUIRED prop and
never reads it, so every caller had to produce and forward a value that was
discarded. Neither `login-form` nor `signup-form` reads it either — each only
declares it, destructures it, and passes it down. `signup-form` forwards it twice,
through its own inner `SignupFormContent` hop.

With the chain gone, `getOAuthProviderStatus` has no consumer for the
`isProduction: isProd` it returned: the pages destructured it only to forward it,
and `/api/auth/providers` already takes just the three availability flags. So the
return value and its `isProd` import go too.

`isProduction` stays alive where it is genuinely used — `verify-content.tsx`
branches on it and hands it to `useVerification`, and imports `isProd` directly
rather than through this helper. That path is untouched.

Found by the rule enabled in #7037: it was the only `.tsx` unused-parameter
warning in `apps/sim`.
This commit is contained in:
Waleed Latif
2026-08-24 12:32:45 -07:00
parent 793e483310
commit 331c2ed2ed
6 changed files with 3 additions and 18 deletions
@@ -3,7 +3,6 @@ import {
isGithubAuthDisabled,
isGoogleAuthDisabled,
isMicrosoftAuthDisabled,
isProd,
} from '@/lib/core/config/env-flags'
export async function getOAuthProviderStatus() {
@@ -16,5 +15,5 @@ export async function getOAuthProviderStatus() {
const microsoftAvailable =
!!(env.MICROSOFT_CLIENT_ID && env.MICROSOFT_CLIENT_SECRET) && !isMicrosoftAuthDisabled
return { githubAvailable, googleAvailable, microsoftAvailable, isProduction: isProd }
return { githubAvailable, googleAvailable, microsoftAvailable }
}
@@ -15,7 +15,6 @@ interface SocialLoginButtonsProps {
googleAvailable: boolean
microsoftAvailable: boolean
callbackURL?: string
isProduction: boolean
children?: ReactNode
}
@@ -24,7 +23,6 @@ export function SocialLoginButtons({
googleAvailable,
microsoftAvailable,
callbackURL = '/workspace',
isProduction,
children,
}: SocialLoginButtonsProps) {
const [isGithubLoading, setIsGithubLoading] = useState(false)
-3
View File
@@ -87,13 +87,11 @@ export default function LoginPage({
githubAvailable,
googleAvailable,
microsoftAvailable,
isProduction,
registrationDisabled,
}: {
githubAvailable: boolean
googleAvailable: boolean
microsoftAvailable: boolean
isProduction: boolean
/** DISABLE_REGISTRATION. Hides the signup cross-link, which `/signup` blocks. */
registrationDisabled: boolean
}) {
@@ -430,7 +428,6 @@ export default function LoginPage({
googleAvailable={googleAvailable}
githubAvailable={githubAvailable}
microsoftAvailable={microsoftAvailable}
isProduction={isProduction}
callbackURL={callbackUrl}
>
{ssoEnabled && !hasOnlySSO && (
+1 -3
View File
@@ -12,8 +12,7 @@ export const metadata: Metadata = {
export const dynamic = 'force-dynamic'
export default async function LoginPage() {
const { githubAvailable, googleAvailable, microsoftAvailable, isProduction } =
await getOAuthProviderStatus()
const { githubAvailable, googleAvailable, microsoftAvailable } = await getOAuthProviderStatus()
return (
<Suspense fallback={<LoginLoading />}>
@@ -21,7 +20,6 @@ export default async function LoginPage() {
githubAvailable={githubAvailable}
googleAvailable={googleAvailable}
microsoftAvailable={microsoftAvailable}
isProduction={isProduction}
registrationDisabled={isRegistrationDisabled}
/>
</Suspense>
+1 -3
View File
@@ -36,15 +36,13 @@ export default async function SignupPage({
)
}
const { githubAvailable, googleAvailable, microsoftAvailable, isProduction } =
await getOAuthProviderStatus()
const { githubAvailable, googleAvailable, microsoftAvailable } = await getOAuthProviderStatus()
return (
<SignupForm
githubAvailable={githubAvailable}
googleAvailable={googleAvailable}
microsoftAvailable={microsoftAvailable}
isProduction={isProduction}
emailSignupEnabled={!isEmailSignupDisabled}
emailVerificationEnabled={isEmailVerificationEffectivelyEnabled()}
/>
@@ -91,7 +91,6 @@ interface SignupFormProps {
githubAvailable: boolean
googleAvailable: boolean
microsoftAvailable: boolean
isProduction: boolean
emailSignupEnabled: boolean
/** Server-derived: verification is enabled AND a mail provider is configured. */
emailVerificationEnabled: boolean
@@ -101,7 +100,6 @@ function SignupFormContent({
githubAvailable,
googleAvailable,
microsoftAvailable,
isProduction,
emailSignupEnabled,
emailVerificationEnabled,
}: SignupFormProps) {
@@ -484,7 +482,6 @@ function SignupFormContent({
googleAvailable={googleAvailable}
microsoftAvailable={microsoftAvailable}
callbackURL={redirectUrl || '/workspace'}
isProduction={isProduction}
>
{ssoEnabled && !hasOnlySSO && (
<SSOLoginButton callbackURL={redirectUrl || '/workspace'} variant='outline' />
@@ -507,7 +504,6 @@ export default function SignupPage({
githubAvailable,
googleAvailable,
microsoftAvailable,
isProduction,
emailSignupEnabled,
emailVerificationEnabled,
}: SignupFormProps) {
@@ -519,7 +515,6 @@ export default function SignupPage({
githubAvailable={githubAvailable}
googleAvailable={googleAvailable}
microsoftAvailable={microsoftAvailable}
isProduction={isProduction}
emailSignupEnabled={emailSignupEnabled}
emailVerificationEnabled={emailVerificationEnabled}
/>