fix: dont allow email exclusion bypass with capital letters (#24741)
* fix: dont allow email exclusion bypass with capital letters * trim before lowercasing to filter out empty tokens * update console message * use only regex change to implement this * use only regex change to implement this
This commit is contained in:
@@ -796,7 +796,7 @@ export type FieldType = z.infer<typeof fieldTypeEnum>;
|
||||
export const excludeOrRequireEmailSchema = z.string().superRefine((val, ctx) => {
|
||||
const allDomains = val.split(",").map((dom) => dom.trim());
|
||||
|
||||
const regex = /^(?:@?[a-z0-9-]+(?:\.[a-z]{2,})?)?(?:@[a-z0-9-]+\.[a-z]{2,})?$/;
|
||||
const regex = /^(?:@?[a-z0-9-]+(?:\.[a-z]{2,})?)?(?:@[a-z0-9-]+\.[a-z]{2,})?$/i;
|
||||
|
||||
/*
|
||||
Valid patterns - [ example, example.anything, anyone@example.anything ]
|
||||
|
||||
Reference in New Issue
Block a user