20 lines
655 B
C#
20 lines
655 B
C#
using ExpenseTracker.Application.Common.Interfaces.Services;
|
|
using MediatR;
|
|
|
|
namespace ExpenseTracker.Application.Authentication.Queries.Login;
|
|
|
|
public class LoginQueryHandler : IRequestHandler<LoginQuery, TokensModel>
|
|
{
|
|
private readonly IAuthenticationService _authenticationService;
|
|
|
|
public LoginQueryHandler(IAuthenticationService authenticationService)
|
|
{
|
|
_authenticationService = authenticationService;
|
|
}
|
|
|
|
public async Task<TokensModel> Handle(LoginQuery request, CancellationToken cancellationToken)
|
|
{
|
|
return await _authenticationService.LoginAsync(request.Email, request.Password, cancellationToken);
|
|
}
|
|
}
|