http-api/src/Application/Authentication/Commands/RevokeRefreshTokenWithCookie/RevokeRefreshTokenWithCookieCommandHandler.cs
2025-04-29 23:51:19 +03:00

29 lines
971 B
C#

using cuqmbr.TravelGuide.Application.Common.Interfaces.Services;
using MediatR;
namespace cuqmbr.TravelGuide.Application.Authenticaion.Commands
.RevokeRefreshTokenWithCookie;
public class RevokeRefreshTokenWithCookieCommandHandler :
IRequestHandler<RevokeRefreshTokenWithCookieCommand>
{
private readonly AuthenticationService _authenticationService;
private readonly SessionUserService _sessionUserService;
public RevokeRefreshTokenWithCookieCommandHandler(
AuthenticationService authenticationService,
SessionUserService sessionUserService)
{
_authenticationService = authenticationService;
_sessionUserService = sessionUserService;
}
public async Task Handle(
RevokeRefreshTokenWithCookieCommand request,
CancellationToken cancellationToken)
{
await _authenticationService.RevokeRefreshTokenAsync(
_sessionUserService.RefreshToken, cancellationToken);
}
}