1
0
mirror of https://github.com/pocket-id/pocket-id.git synced 2026-02-10 11:24:16 +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

@@ -5,7 +5,7 @@
import { preventDefault } from '$lib/utils/event-util';
import { createForm } from '$lib/utils/form-util';
import { tryCatch } from '$lib/utils/try-catch-util';
import { emptyToUndefined } from '$lib/utils/zod-util';
import { emptyToUndefined, usernameSchema } from '$lib/utils/zod-util';
import { z } from 'zod/v4';
let {
@@ -26,11 +26,7 @@
const formSchema = z.object({
firstName: z.string().min(1).max(50),
lastName: emptyToUndefined(z.string().max(50).optional()),
username: z
.string()
.min(2)
.max(30)
.regex(/^[a-z0-9_@.-]+$/, m.username_can_only_contain()),
username: usernameSchema,
email: z.email()
});
type FormSchema = typeof formSchema;