Back to all reviewers

Validate input before submission

unionlabs/union
Based on 1 comments
Other

Always validate user input before enabling form submission to prevent processing of invalid or malicious data. This includes checking for empty required fields, format validation, and business logic constraints. Implement validation checks in the form's disabled state or submission handler to ensure only valid data can be processed.

Security Other

Reviewer Prompt

Always validate user input before enabling form submission to prevent processing of invalid or malicious data. This includes checking for empty required fields, format validation, and business logic constraints. Implement validation checks in the form’s disabled state or submission handler to ensure only valid data can be processed.

Example implementation:

// Disable submit button when validation fails
disabled={$faucetState.kind !== "IDLE" || isValidCosmosAddress(address, ['union']) === false}

This pattern prevents users from submitting forms with empty addresses, invalid formats, or when the application is in an inappropriate state. Client-side validation improves user experience while server-side validation provides security protection against malicious requests.

1
Comments Analyzed
Other
Primary Language
Security
Category

Source Discussions