29 lines
971 B
C#
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);
|
|
}
|
|
}
|