Skip to content

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

Fix: Change SMS_TEMPLATE field from input to textarea (#16077)

Alex Lande5cad547aad63
diff --git a/packages/ui/src/components/Input/Input.tsx b/packages/ui/src/components/Input/Input.tsx
index 0ba0c9f430e..b3737e6493d 100644
--- a/packages/ui/src/components/Input/Input.tsx
+++ b/packages/ui/src/components/Input/Input.tsx
@@ -198,13 +198,13 @@ function Input({
export interface TextAreaProps
extends Omit<React.InputHTMLAttributes<HTMLTextAreaElement>, 'size' | 'onCopy'> {
textAreaClassName?: string
- descriptionText?: string
+ descriptionText?: string | React.ReactNode | undefined
error?: string
icon?: any
label?: string | React.ReactNode
afterLabel?: string
beforeLabel?: string
- labelOptional?: string
+ labelOptional?: string | React.ReactNode
layout?: 'horizontal' | 'vertical'
rows?: number
limit?: number
diff --git a/studio/components/interfaces/Auth/AuthProvidersForm/FormField.tsx b/studio/components/interfaces/Auth/AuthProvidersForm/FormField.tsx
index 348736edd22..a1b60b59cc3 100644
--- a/studio/components/interfaces/Auth/AuthProvidersForm/FormField.tsx
+++ b/studio/components/interfaces/Auth/AuthProvidersForm/FormField.tsx
@@ -132,6 +132,49 @@ const FormField = ({ name, properties, formValues, disabled = false }: FormField
}
/>
)
+ case 'multiline-string':
+ return (
+ <Input.TextArea
+ size="small"
+ layout="vertical"
+ id={name}
+ name={name}
+ disabled={disabled}
+ type={hidden ? 'password' : 'text'}
+ label={properties.title}
+ labelOptional={
+ properties.descriptionOptional ? (
+ <ReactMarkdown unwrapDisallowed disallowedElements={['p']}>
+ {properties.descriptionOptional}
+ </ReactMarkdown>
+ ) : undefined
+ }
+ descriptionText={
+ 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>
+ )
+ }
+ />
+ )
case 'number':
return (
<InputNumber
diff --git a/studio/stores/authConfig/schema/AuthProviders/AuthProvidersFormValidation.tsx b/studio/stores/authConfig/schema/AuthProviders/AuthProvidersFormValidation.tsx
index 4e7d3ce85a7..fc1df7233ce 100644
--- a/studio/stores/authConfig/schema/AuthProviders/AuthProvidersFormValidation.tsx
+++ b/studio/stores/authConfig/schema/AuthProviders/AuthProvidersFormValidation.tsx
@@ -239,7 +239,7 @@ const PROVIDER_PHONE = {
},
SMS_TEMPLATE: {
title: 'SMS Message',
- type: 'string',
+ type: 'multiline-string',
description: 'To format the OTP code use `{{ .Code }}`',
show: {
key: 'SMS_PROVIDER',