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

18 lines
601 B
C#

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