mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-10-10 16:52:47 +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",
|
"title": "Create New User",
|
||||||
"desc": "Add a new user account and specify a role for access to areas of the Frigate UI.",
|
"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 _",
|
"usernameOnlyInclude": "Username may only include letters, numbers, . or _",
|
||||||
|
"usernameOnlyDots": "Username cannot contain only periods",
|
||||||
"confirmPassword": "Please confirm your password"
|
"confirmPassword": "Please confirm your password"
|
||||||
},
|
},
|
||||||
"deleteUser": {
|
"deleteUser": {
|
||||||
|
|||||||
@@ -80,8 +80,11 @@ export default function CreateUserDialog({
|
|||||||
user: z
|
user: z
|
||||||
.string()
|
.string()
|
||||||
.min(1, t("users.dialog.form.usernameIsRequired"))
|
.min(1, t("users.dialog.form.usernameIsRequired"))
|
||||||
.regex(/^(?!\.+$)[A-Za-z0-9._]+$/, {
|
.regex(/^[A-Za-z0-9._]+$/, {
|
||||||
message: t("users.dialog.createUser.usernameOnlyInclude"),
|
message: t("users.dialog.createUser.usernameOnlyInclude"),
|
||||||
|
})
|
||||||
|
.regex(/[^.]/, {
|
||||||
|
message: t("users.dialog.createUser.usernameOnlyDots"),
|
||||||
}),
|
}),
|
||||||
password: z
|
password: z
|
||||||
.string()
|
.string()
|
||||||
|
|||||||
Reference in New Issue
Block a user