23 lines
660 B
C#
23 lines
660 B
C#
using AutobusApi.Application.Common.Interfaces;
|
|
using AutobusApi.Application.Common.Models.Identity;
|
|
using MediatR;
|
|
|
|
namespace AutobusApi.Application.Identity.Queries.Login;
|
|
|
|
public class LoginQueryHandler : IRequestHandler<LoginQuery, TokensModel>
|
|
{
|
|
private readonly IIdentityService _identityService;
|
|
|
|
public LoginQueryHandler(IIdentityService identityService)
|
|
{
|
|
_identityService = identityService;
|
|
}
|
|
|
|
public async Task<TokensModel> Handle(
|
|
LoginQuery request,
|
|
CancellationToken cancellationToken)
|
|
{
|
|
return await _identityService.LoginAsync(request.Email, request.Password, cancellationToken);
|
|
}
|
|
}
|