13 lines
407 B
C#
13 lines
407 B
C#
using Microsoft.AspNetCore.Components.WebAssembly.Authentication;
|
|
using RobotNet.Clients;
|
|
|
|
namespace RobotNet.WebApp.Clients;
|
|
|
|
public abstract class WebAssemblyHubClient(IAccessTokenProvider tokenProvider, Uri uri) : HubClient(uri, async () =>
|
|
{
|
|
var tokenResult = await tokenProvider.RequestAccessToken();
|
|
return tokenResult.TryGetToken(out var token) ? token.Value : "";
|
|
})
|
|
{
|
|
}
|