Skip to content

Commit

Permalink
Merge pull request #2051 from okta/fix-customized-sign-in-import
Browse files Browse the repository at this point in the history
fix customized sign in import
  • Loading branch information
duytiennguyen-okta committed Aug 12, 2024
2 parents cb2324f + 6e6da17 commit 2a8523b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion examples/resources/okta_customized_signin_page/import.sh
Original file line number Diff line number Diff line change
@@ -1 +1 @@
terraform import okta_customized_signin_page.example <customized_signin_page_id>
terraform import okta_customized_signin_page.example <brand_id>
9 changes: 8 additions & 1 deletion okta/resource_okta_customized_signin_page.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,14 @@ func (r *customizedSigninPageResource) Read(ctx context.Context, req resource.Re
return
}

customizedSigninPage, _, err := r.Config.oktaSDKClientV3.CustomizationAPI.GetCustomizedSignInPage(ctx, state.BrandID.ValueString()).Execute()
var brandID string
if state.BrandID.ValueString() != "" {
brandID = state.BrandID.ValueString()
} else {
brandID = state.ID.ValueString()
}

customizedSigninPage, _, err := r.Config.oktaSDKClientV3.CustomizationAPI.GetCustomizedSignInPage(ctx, brandID).Execute()
if err != nil {
resp.Diagnostics.AddError(
"Error retrieving customized signin page",
Expand Down

0 comments on commit 2a8523b

Please sign in to comment.