aboutsummaryrefslogtreecommitdiff
path: root/Timeline.Tests
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2020-02-21 15:10:37 +0800
committercrupest <crupest@outlook.com>2020-02-21 15:10:37 +0800
commitf389661667a510d6accfb412482578b66527e6e4 (patch)
tree57a8579bc8b6d2be2831c8e55d5b5b0f552def35 /Timeline.Tests
parent3fa9899e17df4b1012e8b645915ac15022b84f9b (diff)
downloadtimeline-f389661667a510d6accfb412482578b66527e6e4.tar.gz
timeline-f389661667a510d6accfb412482578b66527e6e4.tar.bz2
timeline-f389661667a510d6accfb412482578b66527e6e4.zip
Move jwt token key from configuration to database and auto generatable.
Diffstat (limited to 'Timeline.Tests')
-rw-r--r--Timeline.Tests/Helpers/TestApplication.cs6
1 files changed, 6 insertions, 0 deletions
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 =>