diff options
Diffstat (limited to 'Program.cs')
| -rw-r--r-- | Program.cs | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -2,6 +2,7 @@ using Microsoft.EntityFrameworkCore; using System.Text.Json.Serialization; using HyperBooru.Services; using Microsoft.AspNetCore.Authentication.Cookies; +using Microsoft.AspNetCore.DataProtection; namespace HyperBooru; @@ -30,6 +31,13 @@ public class Program { builder.Services.AddHostedService<OcrService>(); builder.Services.AddSingleton<ISourceService, SourceService>(); + // Ensure session keys are stored in a persistent location on all platforms + builder.Services.AddDataProtection() + .PersistKeysToFileSystem(new( + builder.Services.BuildServiceProvider() + .GetRequiredService<IConfigService>() + .KeyPath)); + var app = builder.Build(); // Ensure database is created and it's schema is up to date |
