Merge pull request #15522 from supabase/revert-15226-j0/add_twilio_verify_provider

Revert "feat: update studio config to include twilio verify"
This commit is contained in:
Joel Lee authored and GitHub committed 2023-07-03 11:16:58 +02:00
commit 5af17846ac
5 files changed
+12 -94

No files matched your search

@@ -137,9 +137,6 @@ export interface AuthConfig {
SMS_TWILIO_ACCOUNT_SID: string
SMS_TWILIO_AUTH_TOKEN: string
SMS_TWILIO_MESSAGE_SERVICE_SID: string
SMS_TWILIO_VERIFY_ACCOUNT_SID: string
SMS_TWILIO_VERIFY_AUTH_TOKEN: string
SMS_TWILIO_VERIFY_MESSAGE_SERVICE_SID: string
SMS_VONAGE_API_KEY: string
SMS_VONAGE_API_SECRET: string
SMS_VONAGE_FROM: string
@@ -14,8 +14,7 @@ interface Props {
const FormField: FC<Props> = ({ name, properties, formValues, disabled = false }) => {
const [hidden, setHidden] = useState(!!properties.isSecret)
if (properties.show && !properties.show.matches.includes(formValues[properties.show.key]))
return null
if (properties.show && formValues[properties.show.key] !== properties.show.matches) return null
switch (properties.type) {
case 'string':
+1 -3
View File
@@ -106,6 +106,7 @@ const handleGetAll = async (req: NextApiRequest, res: NextApiResponse) => {
EXTERNAL_ZOOM_ENABLED: false,
EXTERNAL_ZOOM_CLIENT_ID: null,
EXTERNAL_ZOOM_SECRET: null,
MAILER_SUBJECTS_INVITE: 'You have been invited',
MAILER_SUBJECTS_CONFIRMATION: 'Confirm Your Signup',
MAILER_SUBJECTS_RECOVERY: 'Reset Your Password',
@@ -136,9 +137,6 @@ const handleGetAll = async (req: NextApiRequest, res: NextApiResponse) => {
SMS_TWILIO_ACCOUNT_SID: null,
SMS_TWILIO_AUTH_TOKEN: null,
SMS_TWILIO_MESSAGE_SERVICE_SID: null,
SMS_TWILIO_VERIFY_ACCOUNT_SID: null,
SMS_TWILIO_VERIFY_AUTH_TOKEN: null,
SMS_TWILIO_VERIFY_MESSAGE_SERVICE_SID: null,
SMS_TEMPLATE: 'Your code is {{ .Code }}',
SECURITY_CAPTCHA_ENABLED: false,
SECURITY_CAPTCHA_PROVIDER: 'hcaptcha',
@@ -81,7 +81,6 @@ const PROVIDER_PHONE = {
{ label: 'Messagebird', value: 'messagebird', icon: 'messagebird-icon.svg' },
{ label: 'Textlocal', value: 'textlocal', icon: 'textlocal-icon.png' },
{ label: 'Vonage', value: 'vonage', icon: 'vonage-icon.svg' },
{ label: 'Twilio Verify', value: 'twilio-verify', icon: 'twilio-icon.svg' }
],
},
RATE_LIMIT_SMS_SENT: {
@@ -96,7 +95,7 @@ const PROVIDER_PHONE = {
title: 'Twilio Account Sid',
show: {
key: 'SMS_PROVIDER',
matches: ['twilio'],
matches: 'twilio',
},
},
SMS_TWILIO_AUTH_TOKEN: {
@@ -105,7 +104,7 @@ const PROVIDER_PHONE = {
isSecret: true,
show: {
key: 'SMS_PROVIDER',
matches: ['twilio'],
matches: 'twilio',
},
},
SMS_TWILIO_MESSAGE_SERVICE_SID: {
@@ -113,34 +112,7 @@ const PROVIDER_PHONE = {
title: 'Twilio Message Service Sid',
show: {
key: 'SMS_PROVIDER',
matches: ['twilio'],
},
},
// Twilio Verify
SMS_TWILIO_VERIFY_ACCOUNT_SID: {
type: 'string',
title: 'Twilio Account Sid',
show: {
key: 'SMS_PROVIDER',
matches: ['twilio-verify'],
},
},
SMS_TWILIO_VERIFY_AUTH_TOKEN: {
type: 'string',
title: 'Twilio Auth Token',
isSecret: true,
show: {
key: 'SMS_PROVIDER',
matches: ['twilio-verify'],
},
},
SMS_TWILIO_VERIFY_MESSAGE_SERVICE_SID: {
type: 'string',
title: 'Twilio Message Service Sid',
show: {
key: 'SMS_PROVIDER',
matches: ['twilio-verify'],
matches: 'twilio',
},
},
@@ -150,7 +122,7 @@ const PROVIDER_PHONE = {
title: 'Messagebird Access Key',
show: {
key: 'SMS_PROVIDER',
matches: ['messagebird'],
matches: 'messagebird',
},
},
SMS_MESSAGEBIRD_ORIGINATOR: {
@@ -158,7 +130,7 @@ const PROVIDER_PHONE = {
title: 'Messagebird Originator',
show: {
key: 'SMS_PROVIDER',
matches: ['messagebird'],
matches: 'messagebird',
},
},
@@ -168,7 +140,7 @@ const PROVIDER_PHONE = {
title: 'Textlocal API Key',
show: {
key: 'SMS_PROVIDER',
matches: ['textlocal'],
matches: 'textlocal',
},
},
SMS_TEXTLOCAL_SENDER: {
@@ -176,7 +148,7 @@ const PROVIDER_PHONE = {
title: 'Textlocal Sender',
show: {
key: 'SMS_PROVIDER',
matches: ['textlocal'],
matches: 'textlocal',
},
},
@@ -186,7 +158,7 @@ const PROVIDER_PHONE = {
title: 'Vonage API Key',
show: {
key: 'SMS_PROVIDER',
matches: ['vonage'],
matches: 'vonage',
},
},
SMS_VONAGE_API_SECRET: {
@@ -194,7 +166,7 @@ const PROVIDER_PHONE = {
title: 'Vonage API Secret',
show: {
key: 'SMS_PROVIDER',
matches: ['vonage'],
matches: 'vonage',
},
},
// [TODO] verify what this is?
@@ -203,7 +175,7 @@ const PROVIDER_PHONE = {
title: 'Vonage From',
show: {
key: 'SMS_PROVIDER',
matches: ['vonage'],
matches: 'vonage',
},
},
@@ -219,29 +191,17 @@ 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({
@@ -271,29 +231,6 @@ const PROVIDER_PHONE = {
otherwise: (schema) => schema,
}),
// Twilio Verify
SMS_TWILIO_VERIFY_ACCOUNT_SID: string().when(['EXTERNAL_PHONE_ENABLED', 'SMS_PROVIDER'], {
is: (EXTERNAL_PHONE_ENABLED: boolean, SMS_PROVIDER: string) => {
return EXTERNAL_PHONE_ENABLED && SMS_PROVIDER === 'twilio-verify'
},
then: (schema) => schema.required('Twilio Verify Account SID is required'),
otherwise: (schema) => schema,
}),
SMS_TWILIO_VERIFY_AUTH_TOKEN: string().when(['EXTERNAL_PHONE_ENABLED', 'SMS_PROVIDER'], {
is: (EXTERNAL_PHONE_ENABLED: boolean, SMS_PROVIDER: string) => {
return EXTERNAL_PHONE_ENABLED && SMS_PROVIDER === 'twilio-verify'
},
then: (schema) => schema.required('Twilio Verify Auth Token is required'),
otherwise: (schema) => schema,
}),
SMS_TWILIO_VERIFY_MESSAGE_SERVICE_SID: string().when(['EXTERNAL_PHONE_ENABLED', 'SMS_PROVIDER'], {
is: (EXTERNAL_PHONE_ENABLED: boolean, SMS_PROVIDER: string) => {
return EXTERNAL_PHONE_ENABLED && SMS_PROVIDER === 'twilio-verify'
},
then: (schema) => schema.required('Twilio Verify Service SID is required'),
otherwise: (schema) => schema,
}),
// Messagebird
SMS_MESSAGEBIRD_ACCESS_KEY: string().when(['EXTERNAL_PHONE_ENABLED', 'SMS_PROVIDER'], {
is: (EXTERNAL_PHONE_ENABLED: boolean, SMS_PROVIDER: string) => {
@@ -543,19 +543,6 @@
"type": "string",
"help": "Twilio message service SID or twilio phone number"
},
"SMS_TWILIO_VERIFY_ACCOUNT_SID": {
"title": "Twilio account SID",
"type": "string"
},
"SMS_TWILIO_VERIFY_AUTH_TOKEN": {
"title": "Twilio Verify auth token",
"type": "string"
},
"SMS_TWILIO_VERIFY_MESSAGE_SERVICE_SID": {
"title": "Twilio Verify service SID",
"type": "string",
"help": "Twilio Verify service SID"
},
"SMS_MESSAGEBIRD_ACCESS_KEY": {
"title": "Messagebird access key",
"type": "string"