mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-10-14 10:42:49 +03:00
Reject dot-only usernames (#24611)
* reject usernames made only of dots
A username of "." or ".." passed validation, but browsers resolve those as path segments, so requests to /users/{username} never reached the API and the user could not be deleted or edited from the UI. User creation now rejects dot-only names in both the API and the create user dialog.
* 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:
@@ -82,6 +82,9 @@ export default function CreateUserDialog({
|
||||
.min(1, t("users.dialog.form.usernameIsRequired"))
|
||||
.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