aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/slskd/Program.cs4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/slskd/Program.cs b/src/slskd/Program.cs
index af571a4e..66fe9762 100644
--- a/src/slskd/Program.cs
+++ b/src/slskd/Program.cs
@@ -31,6 +31,7 @@ namespace slskd
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authentication.JwtBearer;
using Microsoft.AspNetCore.Builder;
+ using Microsoft.AspNetCore.DataProtection;
using Microsoft.AspNetCore.Diagnostics;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http;
@@ -475,6 +476,9 @@ namespace slskd
.SetIsOriginAllowed((host) => true)
.AllowCredentials()));
+ services.AddDataProtection()
+ .PersistKeysToFileSystem(new DirectoryInfo(Path.Combine(AppDirectory, "data", ".DataProtection-Keys")));
+
var jwtSigningKey = new SymmetricSecurityKey(Encoding.UTF8.GetBytes(OptionsAtStartup.Web.Authentication.Jwt.Key));
services.AddSingleton(jwtSigningKey);