Skip to content

Commit

Permalink
Don't use JsonObject.Merge() in Azure AD Deployment Source (#16841)
Browse files Browse the repository at this point in the history
  • Loading branch information
hishamco authored Oct 7, 2024
1 parent 52958dc commit de60815
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 17 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
using System.Text.Json;
using System.Text.Json.Nodes;
using OrchardCore.Deployment;
using OrchardCore.Microsoft.Authentication.Services;
Expand All @@ -22,12 +21,12 @@ public async Task ProcessDeploymentStepAsync(DeploymentStep step, DeploymentPlan
return;
}

var settings = await _azureADService.GetSettingsAsync();
var azureADSettings = await _azureADService.GetSettingsAsync();

var obj = new JsonObject { ["name"] = nameof(AzureADSettings) };

obj.Merge(JObject.FromObject(settings, JOptions.Default));

result.Steps.Add(obj);
result.Steps.Add(new JsonObject
{
["name"] = "Settings",
[nameof(AzureADSettings)] = JObject.FromObject(azureADSettings),
});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,9 @@ public override void ConfigureServices(IServiceCollection services)
services.AddRecipeExecutionStep<MicrosoftAccountSettingsStep>();

services.AddTransient<IConfigureOptions<MicrosoftAccountSettings>, MicrosoftAccountSettingsConfiguration>();

// Register the options initializers required by the Microsoft Account Handler.
services.TryAddEnumerable(new[]
{
// Orchard-specific initializers:
ServiceDescriptor.Transient<IConfigureOptions<AuthenticationOptions>, MicrosoftAccountOptionsConfiguration>(),
ServiceDescriptor.Transient<IConfigureOptions<MicrosoftAccountOptions>, MicrosoftAccountOptionsConfiguration>(),
// Built-in initializers:
ServiceDescriptor.Transient<IPostConfigureOptions<MicrosoftAccountOptions>, OAuthPostConfigureOptions<MicrosoftAccountOptions, MicrosoftAccountHandler>>()
});
services.AddTransient<IConfigureOptions<AuthenticationOptions>, MicrosoftAccountOptionsConfiguration>();
services.AddTransient<IConfigureOptions<MicrosoftAccountOptions>, MicrosoftAccountOptionsConfiguration>();
services.AddTransient<IPostConfigureOptions<MicrosoftAccountOptions>, OAuthPostConfigureOptions<MicrosoftAccountOptions, MicrosoftAccountHandler>>();
}
}

Expand Down

0 comments on commit de60815

Please sign in to comment.