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
commit7190c888d7216485db860566f0e89037d7aab972 (patch)
treeae1e552175d291f1f20372d84dcc6dc5cbd769bb /BackEnd/Timeline.Tests
parent04737cd734eda58eca5da59d5a6a35c0dc1e9364 (diff)
downloadtimeline-7190c888d7216485db860566f0e89037d7aab972.tar.gz
timeline-7190c888d7216485db860566f0e89037d7aab972.tar.bz2
timeline-7190c888d7216485db860566f0e89037d7aab972.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]