Architecture
Form validation
How Backstack handles form validation.
The API validates all incoming form data and returns an actionable user
type error object if any values are missing or invalid.
{
"success": false,
"message": "Required values are missing",
"payload": {
"type": "user",
"fields": {
"username": "Required value",
"password": "Cannot be your username"
},
...
}
}
The error.fields
array contains field names and their associated error messages.
The message
provides details to help the user resolve the issue.
See the Errors page for more information on error handling.