Skip to content
This repository has been archived by the owner on Mar 8, 2022. It is now read-only.

Fix reading auth0_branding when enable_custom_domain_in_emails is true #438

Merged
merged 3 commits into from
Jan 20, 2022

Conversation

nekootoko3
Copy link
Contributor

@nekootoko3 nekootoko3 commented Sep 1, 2021

Proposed Changes

  • Enables you to set auth0_branding when custom domain is enabled and universal_login is not set
    • By current provider behavior, when custom domain is enabled, custom universal login pages must be set. From document, when custom domain is enabled, it is true that universal login pages can be set, but you don't have to.

Fixes #380

Acceptance Test Output

$ make testacc TESTS=TestAccBranding                                                         
==> Checking that code complies with gofmt requirements...
?       github.com/alexkappa/terraform-provider-auth0   [no test files]
=== RUN   TestAccBranding
--- PASS: TestAccBranding (8.76s)
PASS
coverage: 7.6% of statements
ok      github.com/alexkappa/terraform-provider-auth0/auth0     9.120s  coverage: 7.6% of statements
?       github.com/alexkappa/terraform-provider-auth0/auth0/internal/debug      [no test files]
testing: warning: no tests to run
PASS
coverage: 0.0% of statements
ok      github.com/alexkappa/terraform-provider-auth0/auth0/internal/random     0.423s  coverage: 0.0% of statements [no tests to run]
testing: warning: no tests to run
PASS
coverage: 0.0% of statements
ok      github.com/alexkappa/terraform-provider-auth0/auth0/internal/validation 0.478s  coverage: 0.0% of statements [no tests to run]
?       github.com/alexkappa/terraform-provider-auth0/version   [no test files]

Community Note

  • Please vote on this pull request by adding a 👍 reaction to the original pull request comment to help the community and maintainers prioritize this request
  • Please do not leave "+1" comments, they generate extra noise for pull request followers and do not help prioritize the request

@nekootoko3
Copy link
Contributor Author

Testing in an environment with no custom domain is complete.
But I could not test in an enviroment with custom domain because I don't have any paid enviroment which I can test in.

@nekootoko3 nekootoko3 marked this pull request as ready for review September 1, 2021 05:05
@nekootoko3 nekootoko3 changed the title [WIP] Fix reading auth0_branding when enable_custom_domain_in_emails is true Fix reading auth0_branding when enable_custom_domain_in_emails is true Sep 1, 2021
@@ -112,12 +111,10 @@ func readBranding(d *schema.ResourceData, m interface{}) error {
}

if t.Flags.EnableCustomDomainInEmails != nil && *t.Flags.EnableCustomDomainInEmails {
ul, err := api.Branding.UniversalLogin()
if err != nil {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in the case of t.Flags.EnableCustomDomainInEmails == true and UniversalLogin is not set, the response is 404 not found and branding cannot be updated.

@nekootoko3
Copy link
Contributor Author

@alexkappa @mpalmer To merge this PR, is there anything for me to do?

@sergiught
Copy link
Collaborator

Hey @nekootoko3! Thanks a lot for this great contribution!

I took a look at it and pushed some small adjustments (mostly styling) and rebased on top of master.

This was a really useful fix!

@sergiught sergiught merged commit fff6b91 into alexkappa:master Jan 20, 2022
@nekootoko3 nekootoko3 deleted the fix-read-branding branch May 8, 2022 13:58
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

auth0_branding fails with an error
2 participants