Test: Integrated google auth
This commit is contained in:
@@ -1,8 +0,0 @@
|
||||
using Google.Apis.Oauth2.v2.Data;
|
||||
|
||||
namespace Hutopy.Application.Common.Interfaces;
|
||||
|
||||
public interface IGoogleService
|
||||
{
|
||||
Task<Userinfo?> GetUserInfoAsync(string accessToken);
|
||||
}
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user