From 1d5d0c85e24fe9f30d587dc714f1cd7a233c8073 Mon Sep 17 00:00:00 2001 From: crupest Date: Fri, 21 Feb 2020 15:10:37 +0800 Subject: Move jwt token key from configuration to database and auto generatable. --- Timeline.Tests/Helpers/TestApplication.cs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'Timeline.Tests/Helpers/TestApplication.cs') diff --git a/Timeline.Tests/Helpers/TestApplication.cs b/Timeline.Tests/Helpers/TestApplication.cs index 5fbc2fb0..52c2f2e2 100644 --- a/Timeline.Tests/Helpers/TestApplication.cs +++ b/Timeline.Tests/Helpers/TestApplication.cs @@ -7,6 +7,7 @@ using System; using System.Collections.Generic; using System.IO; using Timeline.Entities; +using Timeline.Migrations; namespace Timeline.Tests.Helpers { @@ -33,6 +34,11 @@ namespace Timeline.Tests.Helpers using (var context = new DatabaseContext(options)) { context.Database.EnsureCreated(); + context.JwtToken.Add(new JwtTokenEntity + { + Key = JwtTokenGenerateHelper.GenerateKey() + }); + context.SaveChanges(); } Factory = factory.WithWebHostBuilder(builder => -- cgit v1.2.3