I am working on a project that is made with Blazor Server in .NET 6. I have added controllers for the authentication flow signup, registering and connecting external signin providers.
When wanting to send a GET request to a endpoint I made with the route /register the page loads as expected. On the other hand when a POST is send and the validation is not working, the response looks like this.
{
"type": "https://tools.ietf.org/html/rfc7231#section-6.5.1",
"title": "One or more validation errors occurred.",
"status": 400,
"traceId": "00-5f48e143e34dbb3a8d4223b7a912d679-48179933e0c1adc8-00",
"errors": {
"Email": [
"The Email field is required."
],
"Phone": [
"The Phone field is required."
],
"Lastname": [
"The Lastname field is required."
],
"Password": [
"The Password field is required."
],
"Firstname": [
"The Firstname field is required."
],
"CountryCode": [
"The CountryCode field is required."
]
}
}
No matter what I do and how I do it, the validation will be returned as json, even if the fields that are filled in and meets the requirements. The json is returned with the missing fields, which is fine.
The thing is I can verify the validation is working, since the missing fields is shrinking as fields gets the correct user input.
The expected behaviour is to show the errors above the fields in the register form for instance.