mirror of
https://github.com/fosrl/pangolin.git
synced 2026-02-27 07:16:40 +00:00
allow wildcard emails in email whitelist
This commit is contained in:
@@ -12,7 +12,17 @@ import { and, eq } from "drizzle-orm";
|
||||
const setResourceWhitelistBodySchema = z
|
||||
.object({
|
||||
emails: z
|
||||
.array(z.string().email())
|
||||
.array(
|
||||
z
|
||||
.string()
|
||||
.email()
|
||||
.or(
|
||||
z.string().regex(/^\*@[\w.-]+\.[a-zA-Z]{2,}$/, {
|
||||
message:
|
||||
"Invalid email address. Wildcard (*) must be the entire local part."
|
||||
})
|
||||
)
|
||||
)
|
||||
.max(50)
|
||||
.transform((v) => v.map((e) => e.toLowerCase()))
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user