From ba86ba12732b3290eaa74936950a370966b41ac5 Mon Sep 17 00:00:00 2001 From: Jake Mannens Date: Thu, 16 Apr 2026 02:22:56 +1000 Subject: v0.10a --- Program.cs | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'Program.cs') diff --git a/Program.cs b/Program.cs index e7f1e26..548f6e9 100644 --- a/Program.cs +++ b/Program.cs @@ -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(); builder.Services.AddSingleton(); + // Ensure session keys are stored in a persistent location on all platforms + builder.Services.AddDataProtection() + .PersistKeysToFileSystem(new( + builder.Services.BuildServiceProvider() + .GetRequiredService() + .KeyPath)); + var app = builder.Build(); // Ensure database is created and it's schema is up to date -- cgit v1.3