From dfaa62ea7529aba0a96dd23f54bbeac59b7025ed Mon Sep 17 00:00:00 2001 From: Khwezi Mngoma Date: Sat, 13 Jun 2026 23:34:07 +0200 Subject: [PATCH] Added data protection keys to web iodc middleware regirtration method --- LiteCharms.Features/Extensions/Api.cs | 6 ++++++ LiteCharms.Features/LiteCharms.Features.csproj | 1 + 2 files changed, 7 insertions(+) diff --git a/LiteCharms.Features/Extensions/Api.cs b/LiteCharms.Features/Extensions/Api.cs index a4020d1..96fb0ba 100644 --- a/LiteCharms.Features/Extensions/Api.cs +++ b/LiteCharms.Features/Extensions/Api.cs @@ -53,6 +53,12 @@ public static class Api 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 authOptions = new LiteCharmsSettings(); diff --git a/LiteCharms.Features/LiteCharms.Features.csproj b/LiteCharms.Features/LiteCharms.Features.csproj index 60259b7..4ff6ca2 100644 --- a/LiteCharms.Features/LiteCharms.Features.csproj +++ b/LiteCharms.Features/LiteCharms.Features.csproj @@ -194,6 +194,7 @@ +