Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

Fix toggling of prevent use of leaked passwords in auth config (#41912)

Joshen Limeb81b2a340be
diff --git a/apps/studio/components/interfaces/Auth/AuthProvidersForm/ProviderForm.tsx b/apps/studio/components/interfaces/Auth/AuthProvidersForm/ProviderForm.tsx
index 32ddff87b35..daf0e8bbe13 100644
--- a/apps/studio/components/interfaces/Auth/AuthProvidersForm/ProviderForm.tsx
+++ b/apps/studio/components/interfaces/Auth/AuthProvidersForm/ProviderForm.tsx
@@ -1,10 +1,10 @@
import { PermissionAction } from '@supabase/shared-types/out/constants'
import { Check } from 'lucide-react'
+import { useTheme } from 'next-themes'
import { useQueryState } from 'nuqs'
import { useEffect, useState } from 'react'
import ReactMarkdown from 'react-markdown'
import { toast } from 'sonner'
-import { useTheme } from 'next-themes'
import { useParams } from 'common'
import { Markdown } from 'components/interfaces/Markdown'
@@ -214,6 +214,10 @@ export const ProviderForm = ({ config, provider, isActive }: ProviderFormProps)
: description,
}
const isDisabledDueToPlan = properties.isPaid && isFreePlan
+ const shouldDisable =
+ properties.type === 'boolean'
+ ? isDisabledDueToPlan && !values[x]
+ : isDisabledDueToPlan
return (
<FormField
@@ -222,9 +226,7 @@ export const ProviderForm = ({ config, provider, isActive }: ProviderFormProps)
setFieldValue={setFieldValue}
properties={properties}
formValues={values}
- disabled={
- shouldDisableField(x) || !canUpdateConfig || isDisabledDueToPlan
- }
+ disabled={shouldDisableField(x) || !canUpdateConfig || shouldDisable}
/>
)
})}