Skip to content

Commit

Permalink
ESD-34143: Prevent saving branding data in ul customize command if em…
Browse files Browse the repository at this point in the history
…pty (#968)

Prevent saving branding data in ul customize command if empty
  • Loading branch information
sergiught authored Feb 1, 2024
1 parent 5f72af6 commit 9d0c9db
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions internal/cli/universal_login_customize.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 9d0c9db

Please sign in to comment.