[#706] skip malformed email adresses in get userdatafromEmail (#712)

Co-authored-by: Camille Moussu <cmoussu@linagora.com>
This commit is contained in:
Camille Moussu
2026-03-25 12:43:59 +01:00
committed by GitHub
parent 35cd128106
commit d8119e9807
3 changed files with 8 additions and 2 deletions
+1 -2
View File
@@ -26,6 +26,7 @@ import {
} from "react";
import { useI18n } from "twake-i18n";
import { ResourceIcon } from "./ResourceIcon";
import { isValidEmail } from "../../utils/isValidEmail";
export interface User {
email: string;
@@ -99,8 +100,6 @@ export function PeopleSearch({
setSnackbarMessage,
} = useUserSearch<User>({ objectTypes, errorMessage });
const isValidEmail = (email: string) =>
/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(email);
const theme = useTheme();
const handleBlurCommit = useCallback(