The Endpoint receives a (Login)Request containg username and password.
There is no validation being executed to check the values for null.
The endpoint starts out by calling .Trim() on the input values. This results in a NullReferenceException and a StatusCode 500.
public override async Task<LoginResponse> ExecuteAsync(Request request, CancellationToken cancellationToken)
{
var user = await _userCredentialsValidator.ValidateAsync(request.Username.Trim(), request.Password.Trim(), cancellationToken);
...
Solution(?)
The Endpoint is built using FastEndpoints. While I am personally not familiar with this framework, I assume that adding a validator should not be too hard.
Additionally, input validation should also be implemented on the client side, providing feedback directly in the ui.
Proceeding-Proposal
As I am a backend engineer, I will take a look on the server side.
Also, as a backend engineer, my UIs may often be functional, though usually not very pretty.
Hence, I would appreciate if someone with more UI skills than me, could help out with this :)
Issue and how to reproduce
What is happening behind the scenes?
Elsa Studio calls the Elsa server's Login Endpoint.
The Endpoint receives a (Login)Request containg username and password. There is no validation being executed to check the values for null.
The endpoint starts out by calling
.Trim()
on the input values. This results in aNullReferenceException
and a StatusCode 500.Solution(?)
The Endpoint is built using FastEndpoints. While I am personally not familiar with this framework, I assume that adding a validator should not be too hard.
Additionally, input validation should also be implemented on the client side, providing feedback directly in the ui.
Proceeding-Proposal
As I am a backend engineer, I will take a look on the server side.
Also, as a backend engineer, my UIs may often be functional, though usually not very pretty. Hence, I would appreciate if someone with more UI skills than me, could help out with this :)
Note
I am using following versions:
and