From 230cffd2a4932fe6b46c5f0e787e6ef4a99ec3ef Mon Sep 17 00:00:00 2001 From: crupest Date: Sun, 16 May 2021 20:17:55 +0800 Subject: fix: Fix backend signalr auth. --- BackEnd/Timeline.Tests/IntegratedTests/TimelineHubTest.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'BackEnd/Timeline.Tests') 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] -- cgit v1.2.3