fix access token sample in SignalR auth document (#8680)

Fixes #8631 

The `AccessTokenFactory` expects a `Task<string>` so we need to wrap it in `Task.FromResult` in the sample (which is synchronous).
pull/8681/head
Andrew Stanton-Nurse 2018-09-24 08:24:26 -07:00 committed by Scott Addie
parent be93b1acb3
commit 55de66375a
1 changed files with 1 additions and 1 deletions

View File

@ -39,7 +39,7 @@ In the .NET client, there is a similar [AccessTokenProvider](xref:signalr/config
var connection = new HubConnectionBuilder()
.WithUrl("https://example.com/myhub", options =>
{
options.AccessTokenProvider = () => _myAccessToken;
options.AccessTokenProvider = () => Task.FromResult(_myAccessToken);
})
.Build();
```