diff options
author | crupest <crupest@outlook.com> | 2021-05-16 20:17:55 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2021-05-16 20:17:55 +0800 |
commit | 7190c888d7216485db860566f0e89037d7aab972 (patch) | |
tree | ae1e552175d291f1f20372d84dcc6dc5cbd769bb /BackEnd/Timeline.Tests | |
parent | 04737cd734eda58eca5da59d5a6a35c0dc1e9364 (diff) | |
download | timeline-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.cs | 8 |
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]
|