Skip to content

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

fix: update frontend

[email protected]af7765a3c471
diff --git a/studio/components/interfaces/Auth/AuthProvidersForm/FormField.tsx b/studio/components/interfaces/Auth/AuthProvidersForm/FormField.tsx
index ddb160631fb..0bbf5940fc3 100644
--- a/studio/components/interfaces/Auth/AuthProvidersForm/FormField.tsx
+++ b/studio/components/interfaces/Auth/AuthProvidersForm/FormField.tsx
@@ -14,7 +14,7 @@ interface Props {
const FormField: FC<Props> = ({ name, properties, formValues, disabled = false }) => {
const [hidden, setHidden] = useState(!!properties.isSecret)
- if (properties.show && formValues[properties.show.key] !== properties.show.matches) return null
+ if (properties.show && !properties.show.matches.includes(formValues[properties.show.key])) return null
switch (properties.type) {
case 'string':
@@ -28,35 +28,35 @@ const FormField: FC<Props> = ({ name, properties, formValues, disabled = false }
type={hidden ? 'password' : 'text'}
label={properties.title}
labelOptional={
- properties.descriptionOptional ? (
- <ReactMarkdown unwrapDisallowed disallowedElements={['p']}>
- {properties.descriptionOptional}
- </ReactMarkdown>
- ) : null
+ properties.descriptionOptional ? (
+ <ReactMarkdown unwrapDisallowed disallowedElements={['p']}>
+ {properties.descriptionOptional}
+ </ReactMarkdown>
+ ) : null
}
descriptionText={
- properties.description ? (
- <ReactMarkdown unwrapDisallowed disallowedElements={['p']}>
- {properties.description}
- </ReactMarkdown>
- ) : null
+ properties.description ? (
+ <ReactMarkdown unwrapDisallowed disallowedElements={['p']}>
+ {properties.description}
+ </ReactMarkdown>
+ ) : null
}
actions={
- !!properties.isSecret ? (
- <Button
- icon={hidden ? <IconEye /> : <IconEyeOff />}
- type="default"
- onClick={() => setHidden(!hidden)}
- />
- ) : (
- <span className="mr-3 text-scale-900">
- {properties.units ? (
- <ReactMarkdown unwrapDisallowed disallowedElements={['p']}>
- {properties.units}
- </ReactMarkdown>
- ) : null}
- </span>
- )
+ !!properties.isSecret ? (
+ <Button
+ icon={hidden ? <IconEye /> : <IconEyeOff />}
+ type="default"
+ onClick={() => setHidden(!hidden)}
+ />
+ ) : (
+ <span className="mr-3 text-scale-900">
+ {properties.units ? (
+ <ReactMarkdown unwrapDisallowed disallowedElements={['p']}>
+ {properties.units}
+ </ReactMarkdown>
+ ) : null}
+ </span>
+ )
}
/>
)
diff --git a/studio/stores/authConfig/schema/AuthProviders/AuthProvidersFormValidation.tsx b/studio/stores/authConfig/schema/AuthProviders/AuthProvidersFormValidation.tsx
index 42da2dd8ef8..d10cc194ee9 100644
--- a/studio/stores/authConfig/schema/AuthProviders/AuthProvidersFormValidation.tsx
+++ b/studio/stores/authConfig/schema/AuthProviders/AuthProvidersFormValidation.tsx
@@ -215,17 +215,29 @@ const PROVIDER_PHONE = {
type: 'number',
description: 'Duration before an SMS OTP expires',
units: 'seconds',
+ show: {
+ key: 'SMS_PROVIDER',
+ matches: ['twilio', 'messagebird', 'textlocal', 'vonage']
+ }
},
SMS_OTP_LENGTH: {
title: 'SMS OTP Length',
type: 'number',
description: 'Number of digits in OTP',
units: 'digits',
+ show: {
+ key: 'SMS_PROVIDER',
+ matches: ['twilio', 'messagebird', 'textlocal', 'vonage']
+ }
},
SMS_TEMPLATE: {
title: 'SMS Message',
type: 'string',
description: 'To format the OTP code use `{{ .Code }}`',
+ show: {
+ key: 'SMS_PROVIDER',
+ matches: ['twilio', 'messagebird', 'textlocal', 'vonage']
+ }
},
},
validationSchema: object().shape({