Added data protection keys to web iodc middleware regirtration method
continuous-integration/drone/pr Build is passing

This commit is contained in:
Khwezi Mngoma
2026-06-13 23:34:07 +02:00
parent 0ec7ef4861
commit dfaa62ea75
2 changed files with 7 additions and 0 deletions
+6
View File
@@ -53,6 +53,12 @@ public static class Api
public static IServiceCollection AddLiteCharmsWebSecurity(this IServiceCollection services, IConfiguration configuration) public static IServiceCollection AddLiteCharmsWebSecurity(this IServiceCollection services, IConfiguration configuration)
{ {
var keysFolder = Path.Combine("/app/shared-keys");
services.AddDataProtection()
.PersistKeysToFileSystem(new DirectoryInfo(keysFolder))
.SetApplicationName("MidrandBooks");
var configSection = configuration.GetSection(nameof(LiteCharmsSettings)); var configSection = configuration.GetSection(nameof(LiteCharmsSettings));
var authOptions = new LiteCharmsSettings(); var authOptions = new LiteCharmsSettings();
@@ -194,6 +194,7 @@
<!-- Shared Usings --> <!-- Shared Usings -->
<ItemGroup> <ItemGroup>
<Using Include="Microsoft.AspNetCore.DataProtection" />
<Using Include="Microsoft.AspNetCore.Components.Server.ProtectedBrowserStorage" /> <Using Include="Microsoft.AspNetCore.Components.Server.ProtectedBrowserStorage" />
<Using Include="System.Text.Json.Serialization" /> <Using Include="System.Text.Json.Serialization" />
<Using Include="System.Reflection" /> <Using Include="System.Reflection" />