diff --git a/web/public/locales/en/views/settings.json b/web/public/locales/en/views/settings.json index 1f50863e46..0c26619bc7 100644 --- a/web/public/locales/en/views/settings.json +++ b/web/public/locales/en/views/settings.json @@ -1054,6 +1054,7 @@ "title": "Create New User", "desc": "Add a new user account and specify a role for access to areas of the Frigate UI.", "usernameOnlyInclude": "Username may only include letters, numbers, . or _", + "usernameOnlyDots": "Username cannot contain only periods", "confirmPassword": "Please confirm your password" }, "deleteUser": { diff --git a/web/src/components/overlay/CreateUserDialog.tsx b/web/src/components/overlay/CreateUserDialog.tsx index 0b4f09aa78..2953a29cb9 100644 --- a/web/src/components/overlay/CreateUserDialog.tsx +++ b/web/src/components/overlay/CreateUserDialog.tsx @@ -80,8 +80,11 @@ export default function CreateUserDialog({ user: z .string() .min(1, t("users.dialog.form.usernameIsRequired")) - .regex(/^(?!\.+$)[A-Za-z0-9._]+$/, { + .regex(/^[A-Za-z0-9._]+$/, { message: t("users.dialog.createUser.usernameOnlyInclude"), + }) + .regex(/[^.]/, { + message: t("users.dialog.createUser.usernameOnlyDots"), }), password: z .string()