aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJP Dillingham <jp@dillingham.me>2022-05-17 10:40:29 -0500
committerGitHub <noreply@github.com>2022-05-17 10:40:29 -0500
commit8eb8d9bf484a3e6f3320b56e18da6cd45b54ac2b (patch)
treef2ddfaa58665238dc8e85cab1ff44e509f8886a7
parent92f7903db4d98ec28a3827d11b4b9c8f67377369 (diff)
parent818fb3570a37fca031c3f1ec665cb6eda2619448 (diff)
downloadslskd-8eb8d9bf484a3e6f3320b56e18da6cd45b54ac2b.tar.gz
Merge branch 'master' into search-list
-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 c815af41..40e6e72d 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;
@@ -476,6 +477,9 @@ namespace slskd
.AllowCredentials()
.WithExposedHeaders("X-URL-Base")));
+ 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);