Add Input Validation for Elsa.Identity Login Endpoint (#4601)

* add validator for login request

* login request: only require parameters to be not null (allow empty/whitespace)
This commit is contained in:
kirill 2023-11-13 20:40:01 +01:00 committed by GitHub
parent 883ca85753
commit 13e9e4fc65
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -0,0 +1,15 @@
using FastEndpoints;
using FluentValidation;
using JetBrains.Annotations;
namespace Elsa.Identity.Endpoints.Login;
[PublicAPI]
internal class RequestValidator : Validator<Request>
{
public RequestValidator()
{
RuleFor(x => x.Username).NotNull();
RuleFor(x => x.Password).NotNull();
}
}