From b78d65565beecef6cff0643950ab851e2d4312d8 Mon Sep 17 00:00:00 2001 From: Josh Hawkins <32435876+hawkeye217@users.noreply.github.com> Date: Fri, 9 Oct 2026 23:59:36 -0500 Subject: [PATCH] show a specific error for dot-only usernames Entering "." or ".." in the create user dialog showed the message listing periods as allowed characters, which didn't explain the rejection. The dialog now checks for dot-only names separately and shows its own message. --- web/public/locales/en/views/settings.json | 1 + web/src/components/overlay/CreateUserDialog.tsx | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) 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()