From ce70c5dcaeabd1e211feb7846c372c7733999b7c Mon Sep 17 00:00:00 2001 From: Sergiu Ghitea <28300158+sergiught@users.noreply.github.com> Date: Thu, 1 Feb 2024 14:08:36 +0100 Subject: [PATCH] Prevent saving branding data in ul customize command if empty --- internal/cli/universal_login_customize.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/internal/cli/universal_login_customize.go b/internal/cli/universal_login_customize.go index dc346272e..f2fac3a88 100644 --- a/internal/cli/universal_login_customize.go +++ b/internal/cli/universal_login_customize.go @@ -607,14 +607,26 @@ func saveUniversalLoginBrandingData(ctx context.Context, api *auth0.API, data *u group, ctx := errgroup.WithContext(ctx) group.Go(func() (err error) { + if data.Settings == nil || data.Settings.String() == "{}" { + return nil + } + return api.Branding.Update(ctx, data.Settings) }) group.Go(func() (err error) { + if data.Template == nil || data.Template.String() == "{}" { + return nil + } + return api.Branding.SetUniversalLogin(ctx, data.Template) }) group.Go(func() (err error) { + if data.Theme == nil || data.Theme.String() == "{}" { + return nil + } + existingTheme, err := api.BrandingTheme.Default(ctx) if err == nil { return api.BrandingTheme.Update(ctx, existingTheme.GetID(), data.Theme)