The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.
TypeScript aialternativeauthdatabasedenoembeddingsexamplefirebasenextjsoauth2pgvectorpostgispostgrespostgresqlpostgrestrealtimesupabasevectorswebsockets
Skip invalidating auth config when toggling security email notification in template editor page (#44888)
Joshen Lim71acf2231841
diff --git a/apps/studio/data/auth/auth-config-update-mutation.ts b/apps/studio/data/auth/auth-config-update-mutation.tsindex 46f37188db6..f21414a47b5 100644--- a/apps/studio/data/auth/auth-config-update-mutation.ts+++ b/apps/studio/data/auth/auth-config-update-mutation.ts@@ -10,6 +10,7 @@ import type { ResponseError, UseCustomMutationOptions } from '@/types'export type AuthConfigUpdateVariables = {projectRef: stringconfig: Partial<components['schemas']['UpdateGoTrueConfigBody']>+ skipInvalidation?: boolean}export async function updateAuthConfig({ projectRef, config }: AuthConfigUpdateVariables) {@@ -41,9 +42,10 @@ export const useAuthConfigUpdateMutation = ({return useMutation<AuthConfigUpdateData, ResponseError, AuthConfigUpdateVariables>({mutationFn: (vars) => updateAuthConfig(vars),async onSuccess(data, variables, context) {- const { projectRef } = variables+ const { projectRef, skipInvalidation = false } = variablesawait Promise.all([- queryClient.invalidateQueries({ queryKey: authKeys.authConfig(projectRef) }),+ !skipInvalidation &&+ queryClient.invalidateQueries({ queryKey: authKeys.authConfig(projectRef) }),queryClient.invalidateQueries({ queryKey: lintKeys.lint(projectRef) }),])await queryClient.refetchQueries({diff --git a/apps/studio/pages/project/[ref]/auth/templates/[templateId].tsx b/apps/studio/pages/project/[ref]/auth/templates/[templateId].tsxindex 47cf34ca5e4..ec1c030dcf8 100644--- a/apps/studio/pages/project/[ref]/auth/templates/[templateId].tsx+++ b/apps/studio/pages/project/[ref]/auth/templates/[templateId].tsx@@ -127,9 +127,9 @@ const RedirectToTemplates = () => {defaultValues,})- const onSubmit = (values: any) => {+ const onSubmit = (values: z.infer<typeof TemplateFormSchema>) => {if (!projectRef) return console.error('Project ref is required')- updateAuthConfig({ projectRef: projectRef, config: { ...values } })+ updateAuthConfig({ projectRef: projectRef, config: { ...values }, skipInvalidation: true })}useEffect(() => {