mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-09-21 18:53:37 +00:00
Add bounds to email SMTP port and rate-limit inputs
Two number inputs on /alerts/notifications had no min/max bounds:
- SMTP port: missing min/max. The browser would accept any
integer, including negative numbers and values outside the TCP
port range. Added min="1" max="65535".
- Rate limit (per minute): missing min. Negative rate limits make
no sense. Added min="1" so the browser surfaces a validation
bubble when an invalid value is typed.
Both bounds are enforced by the browser's native number-input UI and
form validation, which catches typos before they hit the API.
This commit is contained in:
@@ -117,6 +117,8 @@ export function EmailProviderSelect(props: EmailProviderSelectProps) {
|
||||
<label class={labelClass()}>{ALERT_EMAIL_SMTP_PORT_LABEL}</label>
|
||||
<input
|
||||
type="number"
|
||||
min="1"
|
||||
max="65535"
|
||||
value={props.config.port || ''}
|
||||
onInput={(e) => {
|
||||
const value = e.currentTarget.value;
|
||||
@@ -243,6 +245,7 @@ export function EmailProviderSelect(props: EmailProviderSelectProps) {
|
||||
</label>
|
||||
<input
|
||||
type="number"
|
||||
min="1"
|
||||
value={props.config.rateLimit || 60}
|
||||
onInput={(e) =>
|
||||
props.onChange({ ...props.config, rateLimit: parseInt(e.currentTarget.value) })
|
||||
|
||||
Reference in New Issue
Block a user