diff --git a/Endpoint/Program.cs b/Endpoint/Program.cs index 9bc37de..9883828 100644 --- a/Endpoint/Program.cs +++ b/Endpoint/Program.cs @@ -1,4 +1,5 @@ using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.DataProtection; using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.HttpOverrides; using Microsoft.Extensions.Configuration; @@ -94,13 +95,15 @@ public class Program builder.Services.AddJwtToken(builder.Configuration); builder.Services.AddSecurity(builder.Configuration); + builder.Services.AddDataProtection() + .PersistKeysToFileSystem(new DirectoryInfo(PathBuilder.Combine("DataProtection"))); + var app = builder.Build(); app.UseForwardedHeaders(); app.UseStaticFiles(UrlHelper.GetSubPath.TrimEnd('/')); app.UseCors("AllowAll"); app.UseCustomSerilog(); - app.UseForwardedHeaders(); using (var scope = app.Services.CreateScope()) {