Skip to content

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

fix(studio): preserve EXTERNAL_PHONE_ENABLED on phone provider save (#44982)

Ali Waseeme63cca3b4af8
diff --git a/apps/studio/components/interfaces/Auth/AuthProvidersFormValidation.tsx b/apps/studio/components/interfaces/Auth/AuthProvidersFormValidation.tsx
index 2f9b45b2482..dd444177e4a 100644
--- a/apps/studio/components/interfaces/Auth/AuthProvidersFormValidation.tsx
+++ b/apps/studio/components/interfaces/Auth/AuthProvidersFormValidation.tsx
@@ -378,10 +378,12 @@ export const getPhoneProviderValidationSchema = (config: ProjectAuthConfigData)
return enabledSchema.parse(values)
}
})
- // Trick: use transform to ensure the correct shape when EXTERNAL_PHONE_ENABLED is true
+ // Trick: use transform to ensure the correct shape when EXTERNAL_PHONE_ENABLED is true.
+ // enabledSchema strips EXTERNAL_PHONE_ENABLED (not declared on its branches), so re-add it
+ // to keep the flag in the submitted payload.
.transform((values) => {
if (values.EXTERNAL_PHONE_ENABLED === true) {
- return enabledSchema.parse(values)
+ return { ...enabledSchema.parse(values), EXTERNAL_PHONE_ENABLED: true as const }
}
return values
})