fix: storing data protection keys

This commit is contained in:
Polianin Nikita 2024-08-10 23:03:28 +03:00
parent c189cc6955
commit c51a9cecc9

View File

@ -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())
{