The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.
TypeScript aialternativeauthdatabasedenoembeddingsexamplefirebasenextjsoauth2pgvectorpostgispostgrespostgresqlpostgrestrealtimesupabasevectorswebsockets
fix: sms hook validation (#45208)
Vaibhav697b373b0655
diff --git a/apps/studio/components/interfaces/Auth/AuthProvidersFormValidation.tsx b/apps/studio/components/interfaces/Auth/AuthProvidersFormValidation.tsxindex dd444177e4a..c2e44a7f672 100644--- a/apps/studio/components/interfaces/Auth/AuthProvidersFormValidation.tsx+++ b/apps/studio/components/interfaces/Auth/AuthProvidersFormValidation.tsx@@ -261,18 +261,15 @@ const smsProviderDisabledSchema = z// as the SMS hook will be used in place of the configured SMS providerconst makeProviderOptionalWhenSMSHookEnabled = (config: ProjectAuthConfigData,- schema: z.ZodObject<z.ZodRawShape>+ getSchema: (optional?: boolean) => z.ZodObject<z.ZodRawShape>) => {- return config.HOOK_SEND_SMS_ENABLED ? schema.partial() : schema+ return config.HOOK_SEND_SMS_ENABLED ? getSchema(true).partial() : getSchema()}// getPhoneProviderValidationSchema generate the validation schema for the SMS providers// based on whether the SMS hook is enabledexport const getPhoneProviderValidationSchema = (config: ProjectAuthConfigData) => {- const twilioSchema = makeProviderOptionalWhenSMSHookEnabled(- config,- getTwilioPhoneProviderSchema()- )+ const twilioSchema = makeProviderOptionalWhenSMSHookEnabled(config, getTwilioPhoneProviderSchema).merge(z.object({SMS_PROVIDER: z.literal('twilio'),@@ -287,7 +284,7 @@ export const getPhoneProviderValidationSchema = (config: ProjectAuthConfigData)const twilioVerifySchema = makeProviderOptionalWhenSMSHookEnabled(config,- getTwilioVerifyPhoneProviderSchema()+ getTwilioVerifyPhoneProviderSchema).merge(z.object({@@ -302,7 +299,7 @@ export const getPhoneProviderValidationSchema = (config: ProjectAuthConfigData)const messagebirdSchema = makeProviderOptionalWhenSMSHookEnabled(config,- getMessagebirdPhoneProviderSchema()+ getMessagebirdPhoneProviderSchema).merge(z.object({@@ -316,10 +313,7 @@ export const getPhoneProviderValidationSchema = (config: ProjectAuthConfigData).merge(getVonagePhoneProviderSchema(true).partial()).merge(getTextlocalPhoneProviderSchema(true).partial())- const vonageSchema = makeProviderOptionalWhenSMSHookEnabled(- config,- getVonagePhoneProviderSchema()- )+ const vonageSchema = makeProviderOptionalWhenSMSHookEnabled(config, getVonagePhoneProviderSchema).merge(z.object({SMS_PROVIDER: z.literal('vonage'),@@ -334,7 +328,7 @@ export const getPhoneProviderValidationSchema = (config: ProjectAuthConfigData)const textlocalSchema = makeProviderOptionalWhenSMSHookEnabled(config,- getTextlocalPhoneProviderSchema()+ getTextlocalPhoneProviderSchema).merge(z.object({