aboutsummaryrefslogtreecommitdiff
path: root/BackEnd/Timeline.Tests
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2021-05-16 20:17:55 +0800
committercrupest <crupest@outlook.com>2021-05-16 20:17:55 +0800
commit230cffd2a4932fe6b46c5f0e787e6ef4a99ec3ef (patch)
tree4a54bfd3baa105292271b179b3e02deab0fe050c /BackEnd/Timeline.Tests
parent07afe9dea19920a95391e5aa2f356264ee563916 (diff)
downloadtimeline-230cffd2a4932fe6b46c5f0e787e6ef4a99ec3ef.tar.gz
timeline-230cffd2a4932fe6b46c5f0e787e6ef4a99ec3ef.tar.bz2
timeline-230cffd2a4932fe6b46c5f0e787e6ef4a99ec3ef.zip
fix: Fix backend signalr auth.
Diffstat (limited to 'BackEnd/Timeline.Tests')
-rw-r--r--BackEnd/Timeline.Tests/IntegratedTests/TimelineHubTest.cs8
1 files changed, 6 insertions, 2 deletions
diff --git a/BackEnd/Timeline.Tests/IntegratedTests/TimelineHubTest.cs b/BackEnd/Timeline.Tests/IntegratedTests/TimelineHubTest.cs
index 05d4c28c..e8b774d8 100644
--- a/BackEnd/Timeline.Tests/IntegratedTests/TimelineHubTest.cs
+++ b/BackEnd/Timeline.Tests/IntegratedTests/TimelineHubTest.cs
@@ -17,8 +17,12 @@ namespace Timeline.Tests.IntegratedTests
private HubConnection CreateConnection(string? token)
{
- return new HubConnectionBuilder().WithUrl($"http://localhost/api/hub/timeline{(token is null ? "" : "?token=" + token)}",
- options => options.HttpMessageHandlerFactory = _ => TestApp.Server.CreateHandler()).Build();
+ return new HubConnectionBuilder().WithUrl("http://localhost/api/hub/timeline",
+ options =>
+ {
+ options.HttpMessageHandlerFactory = _ => TestApp.Server.CreateHandler();
+ options.AccessTokenProvider = token is null ? null : () => Task.FromResult(token);
+ }).Build();
}
[Theory]