📄 src/Api/YouTubeAuth/YouTubeCredentialsProvider.cs
1 2 3 4 5 6 7 8 9 10 11 12 13 14
using System.Threading;
using System.Threading.Tasks;
using Google.Apis.Auth.AspNetCore3;
using Google.Apis.Auth.OAuth2;
using Slopper.Infrastructure.YouTube;

namespace Slopper.Api.YouTubeAuth;

internal sealed class YouTubeCredentialsProvider(IGoogleAuthProvider googleAuthProvider) : IYouTubeCredentialsProvider
{
    public async Task<ICredential> GetCredentials(CancellationToken cancellationToken) =>
        await googleAuthProvider.GetCredentialAsync(cancellationToken: cancellationToken);
}