mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-10-10 08:42:49 +03:00
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.
This commit is contained in:
@@ -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": {
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user