mirror of
https://github.com/henrygd/beszel.git
synced 2026-04-19 03:11:50 +02:00
fix(hub): use rfcEmail validator to allow IDN/Punycode email addresses (#1935)
valibot's email() action uses a domain-label regex that disallows the -- sequence, so Punycode ACE labels like xn--mnchen-3ya.de (the ASCII form of münchen.de) are incorrectly rejected. Switching to rfcEmail() applies the RFC 5321 domain-label pattern, which allows hyphens within labels and therefore accepts both standard and internationalized domain names.
This commit is contained in:
@@ -17,7 +17,7 @@ import { toast } from "../ui/use-toast"
|
|||||||
import { OtpInputForm } from "./otp-forms"
|
import { OtpInputForm } from "./otp-forms"
|
||||||
|
|
||||||
const honeypot = v.literal("")
|
const honeypot = v.literal("")
|
||||||
const emailSchema = v.pipe(v.string(), v.email(t`Invalid email address.`))
|
const emailSchema = v.pipe(v.string(), v.rfcEmail(t`Invalid email address.`))
|
||||||
const passwordSchema = v.pipe(
|
const passwordSchema = v.pipe(
|
||||||
v.string(),
|
v.string(),
|
||||||
v.minLength(8, t`Password must be at least 8 characters.`),
|
v.minLength(8, t`Password must be at least 8 characters.`),
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ interface ShoutrrrUrlCardProps {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const NotificationSchema = v.object({
|
const NotificationSchema = v.object({
|
||||||
emails: v.array(v.pipe(v.string(), v.email())),
|
emails: v.array(v.pipe(v.string(), v.rfcEmail())),
|
||||||
webhooks: v.array(v.pipe(v.string(), v.url())),
|
webhooks: v.array(v.pipe(v.string(), v.url())),
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user