RobotNet/RobotNet.WebApp/Clients/WebAssemblyHubClient.cs
2025-10-15 15:15:53 +07:00

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 : "";
})
{
}