1
0
mirror of https://github.com/pocket-id/pocket-id.git synced 2026-03-23 10:10:09 +00:00

feat: allow uppercase usernames (#958)

This commit is contained in:
Elias Schneider
2025-09-17 21:43:12 +02:00
committed by GitHub
parent cf0892922b
commit 02249491f8
14 changed files with 71 additions and 27 deletions

View File

@@ -26,3 +26,11 @@ export const callbackUrlSchema = z
message: m.invalid_redirect_url()
}
);
export const usernameSchema = z
.string()
.min(2)
.max(30)
.regex(/^[a-zA-Z0-9]/, m.username_must_start_with())
.regex(/[a-zA-Z0-9]$/, m.username_must_end_with())
.regex(/^[a-zA-Z0-9_.@-]+$/, m.username_can_only_contain());