Skip to content

Commit

Permalink
Fix read branding
Browse files Browse the repository at this point in the history
resolves alexkappa#380
  • Loading branch information
nekootoko3 committed Aug 31, 2021
1 parent 534e1f8 commit 005a8d8
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion auth0/resource_auth0_branding.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ func createBranding(d *schema.ResourceData, m interface{}) error {
func readBranding(d *schema.ResourceData, m interface{}) error {
api := m.(*management.Management)
b, err := api.Branding.Read()

if err != nil {
if mErr, ok := err.(management.Error); ok {
if mErr.Status() == http.StatusNotFound {
Expand All @@ -114,6 +113,12 @@ func readBranding(d *schema.ResourceData, m interface{}) error {
if t.Flags.EnableCustomDomainInEmails != nil && *t.Flags.EnableCustomDomainInEmails {
ul, err := api.Branding.UniversalLogin()
if err != nil {
if mErr, ok := err.(management.Error); ok {
if mErr.Status() == http.StatusNotFound {
d.SetId("")
return nil
}
}
return err
}

Expand Down

0 comments on commit 005a8d8

Please sign in to comment.