classlib/ExpenseTracker.Application/Authentication/Commands/RevokeRefreshTokenWithCookie/RevokeRefreshTokenWithBodyCommandValidator.cs
2024-08-07 21:12:02 +03:00

18 lines
605 B
C#

using ExpenseTracker.Application.Common.Interfaces.Services;
using FluentValidation;
namespace ExpenseTracker.Application.Authentication.Commands.RevokeRefreshTokenWithCookie;
public class RevokeRefreshTokenWithBodyCommandValidator : AbstractValidator<RevokeRefreshTokenWithCookieCommand>
{
private readonly ISessionUserService _sessionUserService;
public RevokeRefreshTokenWithBodyCommandValidator(ISessionUserService sessionUserService)
{
_sessionUserService = sessionUserService;
RuleFor(e => e)
.Must(_ => _sessionUserService.RefreshToken != null);
}
}