Test: Integrated google auth

This commit is contained in:
Kamigen
2024-04-29 18:30:04 -04:00
parent be1d4cb3b6
commit 025195627c
9 changed files with 22 additions and 127 deletions

View File

@@ -1,8 +0,0 @@
using Google.Apis.Oauth2.v2.Data;
namespace Hutopy.Application.Common.Interfaces;
public interface IGoogleService
{
Task<Userinfo?> GetUserInfoAsync(string accessToken);
}

View File

@@ -1,20 +0,0 @@
using Hutopy.Application.Common.Interfaces;
namespace Hutopy.Application.Google.Commands;
public record CreateGoogleUserCommand : IRequest<Guid>
{
public required string AccessToken { get; init; }
}
public class CreateGoogleUser(
IApplicationDbContext context
) : IRequestHandler<CreateGoogleUserCommand, Guid>
{
public async Task<Guid> Handle(CreateGoogleUserCommand request, CancellationToken cancellationToken)
{
await context.SaveChangesAsync(cancellationToken);
return Guid.NewGuid();
}
}