refactor(config): allow GdPicture license key from configuration
- Updated GdPictureOptions setup to read license key from `GdPictureLicenseKey` config value. - Falls back to reading from third-party module if config key is not set.
This commit is contained in:
@@ -92,8 +92,9 @@ try
|
||||
var licenseKey = "GDPICTURE";
|
||||
using var scope = sp.CreateScope();
|
||||
var mediator = scope.ServiceProvider.GetRequiredService<IMediator>();
|
||||
opt.License = mediator.ReadThirdPartyModuleLicenseAsync(licenseKey).GetAwaiter().GetResult()
|
||||
?? throw new InvalidOperationException($"License record not found for key: {licenseKey}");
|
||||
opt.License = config["GdPictureLicenseKey"]
|
||||
?? mediator.ReadThirdPartyModuleLicenseAsync(licenseKey).GetAwaiter().GetResult()
|
||||
?? throw new InvalidOperationException($"License record not found for key: {licenseKey}");
|
||||
});
|
||||
|
||||
var host = builder.Build();
|
||||
|
||||
Reference in New Issue
Block a user