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
parent
be93b1acb3
commit
55de66375a
|
@ -39,7 +39,7 @@ In the .NET client, there is a similar [AccessTokenProvider](xref:signalr/config
|
||||||
var connection = new HubConnectionBuilder()
|
var connection = new HubConnectionBuilder()
|
||||||
.WithUrl("https://example.com/myhub", options =>
|
.WithUrl("https://example.com/myhub", options =>
|
||||||
{
|
{
|
||||||
options.AccessTokenProvider = () => _myAccessToken;
|
options.AccessTokenProvider = () => Task.FromResult(_myAccessToken);
|
||||||
})
|
})
|
||||||
.Build();
|
.Build();
|
||||||
```
|
```
|
||||||
|
|
Loading…
Reference in New Issue